Project

General

Profile

Actions

Defect #15320

closed

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

Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.

Added by William Roush about 13 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
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 2 (1 open — 1 closed)

Related to Redmine - Defect #15811: Changing Ticket's Project In Parent/Child Relationship FailsNewActions
Is duplicate of Redmine - Defect #13654: Can't set parent issue when issue relations among child issues are presentClosedJean-Philippe LangActions

Updated by William Roush about 13 years ago Actions #1

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

Updated by Toru Haraguchi about 13 years ago Actions #2

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

Updated by Toshi MARUYAMA almost 13 years ago Actions #3

  • Category set to Issues

Updated by Toshi MARUYAMA almost 13 years ago Actions #4

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

Updated by @ go2null over 12 years ago Actions #5

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?

Updated by @ go2null over 12 years ago Actions #6

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.

Updated by @ go2null over 12 years ago Actions #7

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

Updated by Toshi MARUYAMA over 12 years ago Actions #8

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

Updated by Christian Ferbar over 11 years ago Actions #9

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.

Updated by Go MAEDA almost 11 years ago Actions #10

  • Resolution set to Duplicate

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

Updated by Go MAEDA almost 11 years ago Actions #11

  • Status changed from New to Closed

Updated by Go MAEDA almost 11 years ago Actions #12

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

Updated by Go MAEDA almost 11 years ago Actions #13

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

Also available in: PDF Atom