@@ -776,7 +776,7 class Project < ActiveRecord::Base | |||||
776 | new_issue.copy_from(issue, :subtasks => false) |
|
776 | new_issue.copy_from(issue, :subtasks => false) | |
777 | new_issue.project = self |
|
777 | new_issue.project = self | |
778 | # Reassign fixed_versions by name, since names are unique per project |
|
778 | # Reassign fixed_versions by name, since names are unique per project | |
779 | if issue.fixed_version |
|
779 | if issue.fixed_version && issue.fixed_version.project == project | |
780 | new_issue.fixed_version = self.versions.detect {|v| v.name == issue.fixed_version.name} |
|
780 | new_issue.fixed_version = self.versions.detect {|v| v.name == issue.fixed_version.name} | |
781 | end |
|
781 | end | |
782 | # Reassign the category by name, since names are unique per project |
|
782 | # Reassign the category by name, since names are unique per project |
@@ -844,6 +844,22 class ProjectTest < ActiveSupport::TestCase | |||||
844 | assert_not_equal assigned_version.id, copied_issue.fixed_version.id # Different record |
|
844 | assert_not_equal assigned_version.id, copied_issue.fixed_version.id # Different record | |
845 | end |
|
845 | end | |
846 |
|
846 | |||
|
847 | should "keep target shared versions from other project" do | |||
|
848 | assigned_version = Version.generate!(:name => "Assigned Issues", :status => 'open', :project_id => 1, :sharing => 'system') | |||
|
849 | issue = Issue.generate_for_project!(@source_project, | |||
|
850 | :fixed_version => assigned_version, | |||
|
851 | :subject => "keep target shared versions", | |||
|
852 | :tracker_id => 1, | |||
|
853 | :project_id => @source_project.id) | |||
|
854 | ||||
|
855 | assert @project.copy(@source_project) | |||
|
856 | @project.reload | |||
|
857 | copied_issue = @project.issues.first(:conditions => {:subject => "keep target shared versions"}) | |||
|
858 | ||||
|
859 | assert copied_issue | |||
|
860 | assert_equal assigned_version, copied_issue.fixed_version | |||
|
861 | end | |||
|
862 | ||||
847 | should "copy issue relations" do |
|
863 | should "copy issue relations" do | |
848 | Setting.cross_project_issue_relations = '1' |
|
864 | Setting.cross_project_issue_relations = '1' | |
849 |
|
865 |
General Comments 0
You need to be logged in to leave comments.
Login now