Commit cd71c1cc authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Do not try to copy relations for issues that could not be copied.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4484 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent ab6a93b0
......@@ -688,12 +688,20 @@ class Project < ActiveRecord::Base
end
self.issues << new_issue
issues_map[issue.id] = new_issue
if new_issue.new_record?
logger.info "Project#copy_issues: issue ##{issue.id} could not be copied: #{new_issue.errors.full_messages}" if logger && logger.info
else
issues_map[issue.id] = new_issue unless new_issue.new_record?
end
end
# Relations after in case issues related each other
project.issues.each do |issue|
new_issue = issues_map[issue.id]
unless new_issue
# Issue was not copied
next
end
# Relations
issue.relations_from.each do |source_relation|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment