Actions
Defect #21758
closedCannot specify parent task if has linked related issue
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Duplicate
Affected version:
Description
Hello.
We found one bug, maybe feature (very strange feature).
- We have 3 tasks: Task 0, Task 1 and Task 2.
- "Task 1" related to "Task 2" (simple relation "Related to" added from "Task 1" important).
- "Task 2" has parent task is "Task 0"
Now we need to specify parent task for "Task 1" and we select "Task 0". So RM says that "Parent task is invalid". Why ?
Hm, ok, lets deceive RM:- remove relation between "Task 1" and "Task 2"
- again link "Task 1" to "Task 0" by field parent task (linked, good)
- and again add relation between "Task 1" and "Task 2" (simple relation "Related to")
Decive again: - remove relation between "Task 1" and "Task 2"
- add related to but from "Task 2"
- and link "Task 1" to "Task 0" by field parent task (linked, good)
- issue.rb:validate_issue checks "@parent_issue.all_dependent_issues.include?(self)". And there is "self" issue, bacause in method gets all childs (Task 2) and gets all related issues by field issue_from_id "Task 2.relations_from.map(&:issue_to)" and, of course, there is self issue.
How to fix: exclude from method "all_dependent_issues" relations with type "TYPE_RELATES" (maybe and others dont want to check triggers in issue model) => "current_issue.relations_from.where('relation_type <> ?', IssueRelation::TYPE_RELATES)"
This methods using only in 2 places: issue.rb:validate_issue and issue_relation.rb:validate_issue_relation
- database manager version - 5.5.45-MariaDB
- Ruby version - 2.2.1-p85 (2015-02-26) [x86_64-linux]
- Rails version 4.2.5
- Redmine version - 3.2.0.stable
- using plugins - none (clear install)
Related issues
Actions