https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292013-11-11T15:53:41ZRedmineRedmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=530672013-11-11T15:53:41ZWilliam Roush
<ul></ul><p>It's a generic "this is an invalid parent ID" changing it to "" then "1000" works fine though.</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=531142013-11-14T05:11:56ZToru Haraguchi
<ul></ul><p>+1<br />We have same issue.<br />Working around by once detaching the child as an independent one.</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=535052013-12-01T06:37:46ZToshi MARUYAMA
<ul><li><strong>Category</strong> set to <i>Issues</i></li></ul> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=541582014-01-07T04:08:34ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-1 priority-4 priority-default" href="/issues/15811">Defect #15811</a>: Changing Ticket's Project In Parent/Child Relationship Fails</i> added</li></ul> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=561812014-05-05T18:14:35Z@ go2null
<ul></ul><p>Using Redmine v2.5.1.</p>
<p>In <code>app/models/issue.rb</code>, there is the following bit of code.<br /><pre><code class="ruby syntaxhl"> <span class="k">elsif</span> <span class="p">(</span><span class="vi">@parent_issue</span> <span class="o">!=</span> <span class="n">parent</span><span class="p">)</span> <span class="o">&&</span> <span class="p">(</span><span class="n">all_dependent_issues</span><span class="p">.</span><span class="nf">include?</span><span class="p">(</span><span class="vi">@parent_issue</span><span class="p">)</span> <span class="o">||</span> <span class="vi">@parent_issue</span><span class="p">.</span><span class="nf">all_dependent_issues</span><span class="p">.</span><span class="nf">include?</span><span class="p">(</span><span class="nb">self</span><span class="p">))</span><span class="err">¬</span>
<span class="c1">#go2null:errors.add :parent_issue_id, :invalid¬</span>
<span class="n">errors</span><span class="p">.</span><span class="nf">add</span> <span class="ss">:parent_issue_id</span><span class="p">,</span> <span class="s2">" - bad depends"</span><span class="err">¬</span>
<span class="k">elsif</span> <span class="o">!</span><span class="n">new_record?</span><span class="err">¬</span>
<span class="c1"># moving an existing issue¬</span>
<span class="k">if</span> <span class="vi">@parent_issue</span><span class="p">.</span><span class="nf">root_id</span> <span class="o">!=</span> <span class="n">root_id</span><span class="err">¬</span>
<span class="c1"># we can always move to another tree¬</span>
<span class="k">elsif</span> <span class="n">move_possible?</span><span class="p">(</span><span class="vi">@parent_issue</span><span class="p">)</span><span class="err">¬</span>
<span class="c1"># move accepted inside tree¬</span>
<span class="k">else</span><span class="err">¬</span>
<span class="n">errors</span><span class="p">.</span><span class="nf">add</span> <span class="ss">:parent_issue_id</span><span class="p">,</span> <span class="ss">:invalid</span><span class="err">¬</span>
<span class="k">end</span><span class="err">¬</span>
<span class="k">end</span><span class="err">¬</span>
</code></pre></p>
<p>It appears that the <em>move accepted inside tree</em> will never be invoked because <code>(all_dependent_issues.include?(@parent_issue) || parent_issue.all_dependent_issues.include?(self))</code> will always be <code>true</code>.</p>
<p>In fact, both <code>all_dependent_issues.include?(@parent_issue)</code> and <code>parent_issue.all_dependent_issues.include?(self)</code> will always be <code>true</code> when moving a grandchild to a grandparent, or vice versa.</p>
<p>Or am I reading this wrong?</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=561912014-05-06T18:32:12Z@ go2null
<ul></ul><p>The <code>elsif</code> was added in <a class="changeset" title="Fixed: Circular loop when using relations and subtasks (#8794)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11641">r11641</a> to fix <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Circular loop when using relations and subtasks (Closed)" href="https://www.redmine.org/issues/8794">#8794</a> <em>Circular loop when using relations and subtasks</em>.</p>
<p>Based on this, it seems that <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Can't set parent issue when issue relations among child issues are present (Closed)" href="https://www.redmine.org/issues/13654">#13654</a> (<em>Can't set parent issue when issue relations among child issues are present</em>) may also be related.</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=561922014-05-06T18:49:29Z@ go2null
<ul></ul><p>It seems that the previous code (<a class="changeset" title="Adds subtasking (#443) including: * priority, start/due dates, progress, estimate, spent time rol..." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/3573">r3573</a>), before <a class="changeset" title="Fixed: Circular loop when using relations and subtasks (#8794)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/11641">r11641</a>, which implemented subtasking (#443), allowed moving grandchild (descendents) around the tree. (<code># move accepted inside tree</code>).</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=565792014-06-02T04:05:55ZToshi MARUYAMA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/13654">Defect #13654</a>: Can't set parent issue when issue relations among child issues are present</i> added</li></ul> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=653722015-08-11T18:23:44ZChristian Ferbar
<ul><li><strong>File</strong> <a href="/attachments/14097">issue_parent.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/14097/issue_parent.patch">issue_parent.patch</a> added</li></ul><p>This patch prints the reason why the parent issue is bad. For example if you have the issues</p>
<p><em>new_parent</em><br /><em>issue</em>, parent: new_parent<br /><em>editing_issue</em>, subtasks: <em>issue</em></p>
<p>if you set the parent of <em>editing_issue</em> to <em>new_parent</em> it will print that <em>issue</em> is already a child of <em>new_parent</em> . On the other hand it will print that a loop would be generated if so.</p>
<p>could you add my patch pls ... or something more advanced with translation...</p>
<p>Anybody knows why there is a check for @parent_issue.all_dependent_issues.include?(self)? This won't produce a loop.</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=686272016-01-17T01:15:55ZGo MAEDA
<ul><li><strong>Resolution</strong> set to <i>Duplicate</i></li></ul><p>Fixed by <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Can't set parent issue when issue relations among child issues are present (Closed)" href="https://www.redmine.org/issues/13654">#13654</a>. We can complete the described operation since <a class="changeset" title="Can't set parent issue when issue relations among child issues are present (#13654)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/15056">r15056</a>.</p> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=686282016-01-17T01:16:12ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=686302016-01-17T01:16:40ZGo MAEDA
<ul><li><strong>Related to</strong> deleted (<i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/13654">Defect #13654</a>: Can't set parent issue when issue relations among child issues are present</i>)</li></ul> Redmine - Defect #15320: Changing Child's Parent Ticket Field To Parent's Parent fails.https://www.redmine.org/issues/15320?journal_id=686312016-01-17T01:16:50ZGo MAEDA
<ul><li><strong>Is duplicate of</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/13654">Defect #13654</a>: Can't set parent issue when issue relations among child issues are present</i> added</li></ul>