Project

General

Profile

Actions

Defect #17580

closed

After copying a task, setting the parent as the orignal task's parent triggers an error

Added by Olivier Houdas almost 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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

17580-RM-3.1.1.patch (2.17 KB) 17580-RM-3.1.1.patch Olivier Houdas, 2015-10-20 17:21

Related issues

Related to Redmine - Defect #12893: Copying an issue does not copy parent task idClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #13654: Can't set parent issue when issue relations among child issues are presentClosedJean-Philippe Lang

Actions
Actions

Also available in: Atom PDF