summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-30 08:09:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-30 08:09:48 +0000
commit84a40b16f18cfa6e00b806ef22628659bf8f67c2 (patch)
treefbc8590a1b1bf67e06a88f21e4835ba5d5c70b39
parent79bc6a7d478ff77514587565da6131ae684ce3c2 (diff)
downloadredmine-84a40b16f18cfa6e00b806ef22628659bf8f67c2.tar.gz
redmine-84a40b16f18cfa6e00b806ef22628659bf8f67c2.zip
Merged r14268 (#19815).
git-svn-id: http://svn.redmine.org/redmine/branches/2.6-stable@14278 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb9
-rw-r--r--test/functional/issues_controller_test.rb4
2 files changed, 8 insertions, 5 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 99e14829b..52272a2ee 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -256,12 +256,15 @@ class IssuesController < ApplicationController
def bulk_update
@issues.sort!
@copy = params[:copy].present?
+
attributes = parse_params_for_bulk_issue_attributes(params)
+ copy_subtasks = (params[:copy_subtasks] == '1')
+ copy_attachments = (params[:copy_attachments] == '1')
unsaved_issues = []
saved_issues = []
- if @copy && params[:copy_subtasks].present?
+ if @copy && copy_subtasks
# Descendant issues will be copied with the parent task
# Don't copy them twice
@issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
@@ -271,8 +274,8 @@ class IssuesController < ApplicationController
orig_issue.reload
if @copy
issue = orig_issue.copy({},
- :attachments => params[:copy_attachments].present?,
- :subtasks => params[:copy_subtasks].present?
+ :attachments => copy_attachments,
+ :subtasks => copy_subtasks
)
else
issue = orig_issue
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index d2d9df783..5c5960401 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3866,7 +3866,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_difference 'Issue.count', 1 do
assert_no_difference 'Attachment.count' do
- post :bulk_update, :ids => [3], :copy => '1',
+ post :bulk_update, :ids => [3], :copy => '1', :copy_attachments => '0',
:issue => {
:project_id => ''
}
@@ -3907,7 +3907,7 @@ class IssuesControllerTest < ActionController::TestCase
@request.session[:user_id] = 2
assert_difference 'Issue.count', 1 do
- post :bulk_update, :ids => [issue.id], :copy => '1',
+ post :bulk_update, :ids => [issue.id], :copy => '1', :copy_subtasks => '0',
:issue => {
:project_id => ''
}