Defect #15320
closedChanging Child's Parent Ticket Field To Parent's Parent fails.
Added by William Roush about 11 years ago. Updated almost 9 years ago.
0%
Description
Example:
- 1000
- 1001
- 1002
- 1001
Changing 1002's parent from 1001 -> 1000 results in an error.
Files
issue_parent.patch (1.16 KB) issue_parent.patch | Christian Ferbar, 2015-08-11 19:53 |
Related issues
Updated by William Roush about 11 years ago
It's a generic "this is an invalid parent ID" changing it to "" then "1000" works fine though.
Updated by Toru Haraguchi about 11 years ago
+1
We have same issue.
Working around by once detaching the child as an independent one.
Updated by Toshi MARUYAMA almost 11 years ago
- Related to Defect #15811: Changing Ticket's Project In Parent/Child Relationship Fails added
Updated by @ go2null over 10 years ago
Using Redmine v2.5.1.
In 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 true
.
In fact, both all_dependent_issues.include?(@parent_issue)
and 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?
Updated by Toshi MARUYAMA over 10 years ago
- Related to Defect #13654: Can't set parent issue when issue relations among child issues are present added
Updated by Christian Ferbar over 9 years ago
- File issue_parent.patch issue_parent.patch added
This patch prints the reason why the parent issue is bad. For example if you have the issues
new_parent
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.
Updated by Go MAEDA almost 9 years ago
- Related to deleted (Defect #13654: Can't set parent issue when issue relations among child issues are present)
Updated by Go MAEDA almost 9 years ago
- Is duplicate of Defect #13654: Can't set parent issue when issue relations among child issues are present added