Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error updating existing issues, Redmine 3.1 (solved) #46

Open
sbriand opened this issue Jun 17, 2016 · 0 comments
Open

Error updating existing issues, Redmine 3.1 (solved) #46

sbriand opened this issue Jun 17, 2016 · 0 comments

Comments

@sbriand
Copy link

sbriand commented Jun 17, 2016

I was not able to update existing issue during import.

In the file production.log in the folder \redmine\log, I noticed the error :

NoMethodError (undefined method `project_id' for #<Issue::ActiveRecord_Relation:0x0000000f0c64a8>):
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

After investigation and debugging session, I have located the problem in the file importer_controller.rb, line 141

140   if unique_attr == "id"
141       issues = [Issue.where(:id => attr_value)]
142   else

The type of the array "issues" is Issue::ActiveRecord_Relation, instead of Issue, which I whould expect. That is the reason why, afterward, I get the error undefined method `project_id'.

Solution :
I have modified the source code as follow.

140   if unique_attr == "id"
141       issues = Issue.where(:id => attr_value).to_a
142   else

It is working normally now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant