Project

General

Profile

Defect #1191

NoMethodError (undefined method `all_dependent_issues' for #<Issue:0x007f09168c83d8>)

Added by Bartosz Firyn almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Category:
Product backlog
Target version:
Source:
Testing
Detected on version:
Blocked:
No
Alone:
Milestones:
Sprint:

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

sort.png (33.5 KB) sort.png Bartosz Firyn, 2016-09-09 12:30
dependencies-disable.png (27 KB) dependencies-disable.png Bartosz Firyn, 2016-10-07 11:07

Subtasks

To do #1222: Add patch to take care of new Redmine 3.3.x API for issues relationshipsResolvedEmilio González MontañaActions
To do #1223: Move PBIs (move top/bottom, move before/after) doesn't check dependenciesResolvedEmilio González MontañaActions

Related issues

Has duplicate Scrum - Defect #1200: Error sorting product backlog in Redmine 3.3.0RejectedActions
Has duplicate Scrum - Defect #1211: 500: /product_backlog/check_dependencies undefined method `all_dependent_issues'RejectedActions
#1

Updated by Bartosz Firyn almost 5 years ago

Just FYI, I managed to workaround this issue by not using drag'n'drop functionality but click on the up/down arrows instead.

#2

Updated by Matthew Hoener almost 5 years ago

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.

#3

Updated by Matthew Hoener almost 5 years ago

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.

#4

Updated by Bartosz Firyn almost 5 years ago

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.

#5

Updated by Emilio González Montaña almost 5 years ago

  • 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.

#6

Updated by Bartosz Firyn almost 5 years ago

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.

#7

Updated by Emilio González Montaña almost 5 years ago

  • Has duplicate Defect #1200: Error sorting product backlog in Redmine 3.3.0 added
#8

Updated by Emilio González Montaña almost 5 years ago

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.

#9

Updated by Matthew Hoener almost 5 years ago

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)

#10

Updated by Emilio González Montaña almost 5 years ago

  • 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 :)

#11

Updated by Emilio González Montaña almost 5 years ago

  • Status changed from In progress to Resolved
#12

Updated by Emilio González Montaña over 4 years ago

  • Has duplicate Defect #1211: 500: /product_backlog/check_dependencies undefined method `all_dependent_issues' added

Also available in: Atom PDF