]> source.dussan.org Git - redmine.git/commitdiff
Do not link copied issues when copying a project (#6899).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 27 Sep 2012 22:27:37 +0000 (22:27 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 27 Sep 2012 22:27:37 +0000 (22:27 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10495 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
app/models/project.rb

index 0d226455d575d0edcb8be71cf437c2f5db384b09..b4415434099ca212aadff3f225eecfa15e3aa5f5 100644 (file)
@@ -1017,7 +1017,7 @@ class Issue < ActiveRecord::Base
   def after_create_from_copy
     return unless copy? && !@after_create_from_copy_handled
 
-    if @copied_from.project_id == project_id || Setting.cross_project_issue_relations?
+    if (@copied_from.project_id == project_id || Setting.cross_project_issue_relations?) && @copy_options[:link] != false
       relation = IssueRelation.new(:issue_from => @copied_from, :issue_to => self, :relation_type => IssueRelation::TYPE_COPIED_TO)
       unless relation.save
         logger.error "Could not create relation while copying ##{@copied_from.id} to ##{id} due to validation errors: #{relation.errors.full_messages.join(', ')}" if logger
index 9a65bdd2ee5bb7a4135f377584713cb1a1994be0..295d3cb05f9086302ebbb994fb4b5b3bef738b32 100644 (file)
@@ -778,7 +778,7 @@ class Project < ActiveRecord::Base
     # get copied before their children
     project.issues.find(:all, :order => 'root_id, lft').each do |issue|
       new_issue = Issue.new
-      new_issue.copy_from(issue, :subtasks => false)
+      new_issue.copy_from(issue, :subtasks => false, :link => false)
       new_issue.project = self
       # Reassign fixed_versions by name, since names are unique per project
       if issue.fixed_version && issue.fixed_version.project == project