Project

General

Profile

Actions

Defect #15320

closed

Changing Child's Parent Ticket Field To Parent's Parent fails.

Added by William Roush over 10 years ago. Updated about 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

Example:

  • 1000
    • 1001
      • 1002

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

Related to Redmine - Defect #15811: Changing Ticket's Project In Parent/Child Relationship FailsNew

Actions
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 William Roush over 10 years ago

It's a generic "this is an invalid parent ID" changing it to "" then "1000" works fine though.

Actions #2

Updated by Toru Haraguchi over 10 years ago

+1
We have same issue.
Working around by once detaching the child as an independent one.

Actions #3

Updated by Toshi MARUYAMA about 10 years ago

  • Category set to Issues
Actions #4

Updated by Toshi MARUYAMA about 10 years ago

  • Related to Defect #15811: Changing Ticket's Project In Parent/Child Relationship Fails added
Actions #5

Updated by @ go2null almost 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?

Actions #6

Updated by @ go2null almost 10 years ago

The elsif was added in r11641 to fix #8794 Circular loop when using relations and subtasks.

Based on this, it seems that #13654 (Can't set parent issue when issue relations among child issues are present) may also be related.

Actions #7

Updated by @ go2null almost 10 years ago

It seems that the previous code (r3573), before r11641, which implemented subtasking (#443), allowed moving grandchild (descendents) around the tree. (# move accepted inside tree).

Actions #8

Updated by Toshi MARUYAMA over 9 years ago

  • Related to Defect #13654: Can't set parent issue when issue relations among child issues are present added
Actions #9

Updated by Christian Ferbar over 8 years ago

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.

Actions #10

Updated by Go MAEDA about 8 years ago

  • Resolution set to Duplicate

Fixed by #13654. We can complete the described operation since r15056.

Actions #11

Updated by Go MAEDA about 8 years ago

  • Status changed from New to Closed
Actions #12

Updated by Go MAEDA about 8 years ago

  • Related to deleted (Defect #13654: Can't set parent issue when issue relations among child issues are present)
Actions #13

Updated by Go MAEDA about 8 years ago

  • Is duplicate of Defect #13654: Can't set parent issue when issue relations among child issues are present added
Actions

Also available in: Atom PDF