Defect #1191
NoMethodError (undefined method `all_dependent_issues' for #<Issue:0x007f09168c83d8>)
Added by Bartosz Firyn about 8 years ago.
Updated about 8 years ago.
Description
Hi,
I installed Scrum 0.14.0 (2016-06-21) which I downloaded from:
https://redmine.ociotec.com/attachments/download/384/scrum%20v0.14.0.tar.gz
On top of Redmine 3.3.0 (2016-06-19) which I downloaded from:
http://www.redmine.org/releases/redmine-3.3.0.zip
After I configured Scrum and created several backlog items I tried to sort them out. The GUI displays error "Fail to sort the PBI, check its dependencies. The page will be reloaded." and in the console output I see the following error:
Started POST "/projects/swim/product_backlog/sort" for 127.0.0.1 at 2016-09-09 11:33:36 +0200
Processing by ProductBacklogController#sort as JS
Parameters: {"pbi"=>["6", "7", "5"], "project_id"=>"swim"}
Current user: sarxos (id=5)
Completed 500 Internal Server Error in 72ms (ActiveRecord: 48.8ms)
NoMethodError (undefined method `all_dependent_issues' for #<Issue:0x007f09168c83d8>):
plugins/scrum/app/controllers/product_backlog_controller.rb:156:in `block in get_dependencies'
plugins/scrum/app/controllers/product_backlog_controller.rb:155:in `each'
plugins/scrum/app/controllers/product_backlog_controller.rb:155:in `get_dependencies'
plugins/scrum/app/controllers/product_backlog_controller.rb:31:in `block in sort'
plugins/scrum/app/controllers/product_backlog_controller.rb:27:in `each'
plugins/scrum/app/controllers/product_backlog_controller.rb:27:in `sort'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
<pre>
Files
Just FYI, I managed to workaround this issue by not using drag'n'drop functionality but click on the up/down arrows instead.
Did you manage to get this to work properly? Those up/down arrows move the issues to the top/bottom and it's pretty annoying to sort the whole list like that.
A workaround for this issue is to disable dependency checking by opening plugins/scrum/app/controllers/product_backlog_controller.rb and around line 156 change
dependencies << other_pbi if pbi.all_dependent_issues.include?(other_pbi)
to
dependencies << other_pbi if false
Webserver needs to be restarted after making the change.
Hi Matthew,
No. I haven't found any solution to make this work properly, however the fix you proposed is working well. I can now sort PBIs by drag'n'drop.
- Category set to Product backlog
You could disable dependent checking via plugin settings, you don't need to touch code if you want.
I will take a look to this issue.
Hi Emilio,
Thank you for your hint :) It comes out how much useful documentation would be. I had no idea that I can disable this from configuration.
I modified the code back to the original form and after disabling dependencies check in configuration, the sort by dran'n'drop work well.
- Has duplicate Defect #1200: Error sorting product backlog in Redmine 3.3.0 added
The failing method all_dependent_issues
was present in Redmine 3.1 but it isn't in 3.3.
I will have to implement PBI dependences in other way to make it compatible with new Redmine versions.
I have a proper fix that correctly checks dependencies.
In product_backlog_controller.rb around line 156 change this line:
dependencies << other_pbi if pbi.all_dependent_issues.include?(other_pbi)
To this:
dependencies << other_pbi if pbi.would_reschedule?(other_pbi) || pbi.blocks?(other_pbi)
Figured it out from reading discussion in Redmine [Defect 13654](http://www.redmine.org/issues/13654) and looking at the changes for [Revision 15056](http://www.redmine.org/projects/redmine/repository/revisions/15056)
- Status changed from New to In progress
- Target version set to Scrum v0.15.1
- Sprint set to Sprint 30
Thanks a lot for the analysis of the issue, I will include in next release :)
- Status changed from In progress to Resolved
- Has duplicate Defect #1211: 500: /product_backlog/check_dependencies undefined method `all_dependent_issues' added
Also available in: Atom
PDF