Defect #7023

Copy Function Doesn't Copy SubTasks

Added by John S almost 9 years ago. Updated almost 8 years ago.

Status:ClosedStart date:2010-12-02
Priority:NormalDue date:
Assignee:-% Done:

90%

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

Description

The copy function does not copy the subtasks related to the task being copied. However, when you move a parent task, all subtasks are moved with it.

issue.rb Magnifier - Issues.rb to copy subtasks with parent tasks. (31.1 KB) John S, 2011-01-06 14:58

issue.rb.1.1.0.copy_children.patch Magnifier - patch to merge John S's issue.rb into 1.1.0 branch (1.24 KB) Daniel Reiche, 2011-01-19 16:46

issue.rb.1.1.0.copy_children.patch Magnifier - Revised working patch for issue.rb from 1.1.0 - r4732 (1.43 KB) Daniel Reiche, 2011-01-20 09:45


Related issues

Duplicates Redmine - Feature #6965: Option to Copy Subtasks when copying an issue Closed 2010-11-23

History

#1 Updated by John S almost 9 years ago

  • % Done changed from 0 to 90

We have been able to make changes so that when you copy a task that has subtasks related to it, all the subtasks are copied as well.

We made the changes in the issues.rb model. If anyone needs the same, let me know.

#2 Updated by Yrs ONE almost 9 years ago

This functionality will be very useful for us.

#3 Updated by John S almost 9 years ago

Here is a copy of the issues.rb file. You need to replace the existing issues.rb file. The changes that were made start on line 169.

Hope it helps.

#4 Updated by Yrs ONE almost 9 years ago

Thanks !

#5 Updated by Serge ST almost 9 years ago

I have tested it and seems to work fine, but I dont like the idea of replacing the existing issue.rb.
Could it be possible to make this "copy function" as a plugin?

#6 Updated by John S almost 9 years ago

I am sure it's possible. But I don't have the knowledge or time to make that change. The source code is there... feel free to do whatever you want with it. Wish I could help out more but I already put too much time in figuring out how to make this work and testing it out.

Good Luck!

#7 Updated by Serge ST almost 9 years ago

tnx I'll give it a shot!

#8 Updated by Daniel Reiche almost 9 years ago

Any chance of this making it into 1.1.x or at least trunk?

#9 Updated by Daniel Reiche over 8 years ago

added patch for 1.1.0 branch to incorporate modified issue.rb from John S

#10 Updated by Daniel Reiche over 8 years ago

Beginners Mistake: accidentally merged the copy_children function as private method.
Revised in latest patch

#11 Updated by Miro Karpis over 8 years ago

please, help needed: I have changed the issue.rb + restarted apache and nothing happened (when I copy main tasks it does not copy subtasks). Am I missing something?

#12 Updated by John S over 8 years ago

Also restart the mongrel services?

#13 Updated by Miro Karpis over 8 years ago

John S wrote:

Also restart the mongrel services?

didn't work. Not sure if the order is important (apache and mongrel).

#14 Updated by John S over 8 years ago

Miro Karpis wrote:

John S wrote:

Also restart the mongrel services?

didn't work. Not sure if the order is important (apache and mongrel).

All I did was change my issues.rb file and restart all the services. If that isn't working for you, I am not sure why. Hopefully someone else can provide an answer. (Mine still works as coded)

#15 Updated by Zbynek Drlik about 8 years ago

  • Assignee set to Jean-Philippe Lang

+1

#16 Updated by Liam Randall about 8 years ago

Testing this on a bitnami 1.2.0 stable host:

bitnami@linux:/opt/bitnami/apps/redmine$ sudo patch p0 < /home/bitnami/redmine/patches/copy_children/issue.rb.1.1.0.copy_children.patch
patching file app/models/issue.rb
Hunk #1 succeeded at 205 (offset 28 lines).
Hunk #2 FAILED at 902.
1 out of 2 hunks FAILED -
saving rejects to file app/models/issue.rb.rej

Went ahead and tested anyway and seems to function properly.

#17 Updated by Etienne Massip about 8 years ago

  • Assignee deleted (Jean-Philippe Lang)

Please don't assign issues.

#18 Updated by Etienne Massip almost 8 years ago

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

Closed as duplicate of #6965.

Also available in: Atom PDF