Changing Child's Parent Ticket Field To Parent's Parent fails.
Changing 1002's parent from 1001 -> 1000 results in an error.
#5 Updated by @ go2null about 5 years ago
Using Redmine v2.5.1.
app/models/issue.rb, there is the following bit of code.
elsif (@parent_issue != parent) && (all_dependent_issues.include?(@parent_issue) || @parent_issue.all_dependent_issues.include?(self))¬ #go2null:errors.add :parent_issue_id, :invalid¬ errors.add :parent_issue_id, " - bad depends"¬ elsif !new_record?¬ # moving an existing issue¬ if @parent_issue.root_id != root_id¬ # we can always move to another tree¬ elsif move_possible?(@parent_issue)¬ # move accepted inside tree¬ else¬ errors.add :parent_issue_id, :invalid¬ end¬ end¬
It appears that the move accepted inside tree will never be invoked because
(all_dependent_issues.include?(@parent_issue) || parent_issue.all_dependent_issues.include?(self)) will always be
In fact, both
parent_issue.all_dependent_issues.include?(self) will always be
true when moving a grandchild to a grandparent, or vice versa.
Or am I reading this wrong?
#9 Updated by Christian Ferbar almost 4 years ago
- File issue_parent.patch added
This patch prints the reason why the parent issue is bad. For example if you have the issues
issue, parent: new_parent
editing_issue, subtasks: issue
if you set the parent of editing_issue to new_parent it will print that issue is already a child of new_parent . On the other hand it will print that a loop would be generated if so.
could you add my patch pls ... or something more advanced with translation...
Anybody knows why there is a check for @parent_issue.all_dependent_issues.include?(self)? This won't produce a loop.