Defect #17580
closedAfter copying a task, setting the parent as the orignal task's parent triggers an error
0%
Description
Steps for repro:
1. Create an issue (1), and add a sub-issue (2) to it
2. Copy this sub-issue (creates issue 3)
3. Edit issue 3, set issue 1 as its parent
Result: We get an error that Parent Issue is invalid
4. Copy (2), and while in edit mode, define issue 1 as the parent
Result: this relationship is accepted
5. Create sub-issue (4) of issue 1
6. Display issue 4, add issue 2 as a related issue
Result: this relationship is accepted
Expected result: the behavior should be consistent. As far as I'm concerned, I do not see what would justify that "relations" would be forbidden inside the parent-children tree, so the faulty behavior would be the first result (Parent issue invalid) but I might be missing some cases.
Notes :
1) This is related to #12893 (obviously on purpose, see line 216 of app/models/issue.rb:
self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on")
2) The current behaviour for 1st result is on purpose: the error message is triggered by line 600 of issue.rb:
elsif (@parent_issue != parent) && (all_dependent_issues.include?(@parent_issue) || @parent_issue.all_dependent_issues.include?(self))
which definitely parses parents, children, cousins, etc., but also related issues.
Files
Related issues