summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-04 15:18:16 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-05-04 15:18:16 +0000
commitd69de691a79b9013e993090b324366df5a48efd2 (patch)
treed39233afd85ede488fa4fe1a19d1f7601e93bfc5 /app/controllers
parent70bdb86c534f2acb074f48ddac3070eaf9a9e3d1 (diff)
downloadredmine-d69de691a79b9013e993090b324366df5a48efd2.tar.gz
redmine-d69de691a79b9013e993090b324366df5a48efd2.zip
Fixed that bulk copy raises an error on validation failure (#13943).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11788 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/issues_controller.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 5336d8c24..327530009 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -260,13 +260,15 @@ class IssuesController < ApplicationController
@issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
end
- @issues.each do |issue|
- issue.reload
+ @issues.each do |orig_issue|
+ orig_issue.reload
if @copy
- issue = issue.copy({},
+ issue = orig_issue.copy({},
:attachments => params[:copy_attachments].present?,
:subtasks => params[:copy_subtasks].present?
)
+ else
+ issue = orig_issue
end
journal = issue.init_journal(User.current, params[:notes])
issue.safe_attributes = attributes
@@ -274,7 +276,7 @@ class IssuesController < ApplicationController
if issue.save
saved_issues << issue
else
- unsaved_issues << issue
+ unsaved_issues << orig_issue
end
end