Defect #32487

Copy issue and its subtasks

Added by Dmitry Makurin 9 months ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues
Target version:-
Resolution: Affected version:

Description

When copying an issue with subtasks rgt of root issue is wrong calculating.

Steps to reproduce:
1. Create an issue (let's say issue0)
2. add some subtasks to issue0
3. create new issue from copying issue0 (on copy form mark "Copy subtasks")

Will be created:
  • copy of issue0
  • copy of issue0's subtasks

And issue0's copy creating with wrong rgt. Redmine then fails to find a tree structure and relate all subtasks to parent (root) issue.

History

#1 Updated by Go MAEDA 9 months ago

The lft and rgt value of copied issues look good to me. Could you explain more details?

sqlite> select id, subject, lft, rgt from issues where root_id = 21;
id          subject     lft         rgt
----------  ----------  ----------  ----------
21          issue0      1           6
22          subtask1    2           3
23          subtask2    4           5

#2 Updated by Dmitry Makurin 9 months ago

  • Status changed from New to Resolved

Yeah that looks fine. In our case copied root issue had rgt set to 2 (even thou it has multiple subtasks). Probably something is broken in our environment. I'll try to find out what caused that strange behavior.
Thank you for the reply, Go!

#3 Updated by Go MAEDA 9 months ago

  • Status changed from Resolved to Closed

Actually, parent-child relations are sometimes broken. You can fix it by running the following command in the installation directory of Redmine.

bundle e rails r 'Issue.rebuild_tree!' RAILS_ENV=production

#4 Updated by Markus Boremski 7 months ago

Could you please give me a hint? We have the same Problem here.
Tried to rebuild the tree but do get

`connect': Access denied for user 'root'@'localhost' (using password: NO)

on a bitnami-based installation.

Also available in: Atom PDF