Project

General

Profile

Actions

Defect #21758

closed

Cannot specify parent task if has linked related issue

Added by Vasil Kovalevsky almost 9 years ago. Updated over 8 years ago.

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).

Description:
  • 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)
Why it happened:
  • 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

Our RM info:
  • 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

Is duplicate of Redmine - Defect #13654: Can't set parent issue when issue relations among child issues are presentClosedJean-Philippe Lang

Actions
Actions #1

Updated by Go MAEDA almost 9 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Fixed by #13654. Please wait for Redmine 3.3.0.

Actions #2

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
Actions #3

Updated by Toshi MARUYAMA over 8 years ago

  • Category set to Issues
Actions

Also available in: Atom PDF