##// END OF EJS Templates
Merged r14268 (#19815)....
Jean-Philippe Lang -
r13896:84a40b16f18c
parent child
Show More
@@ -256,12 +256,15 class IssuesController < ApplicationController
256 256 def bulk_update
257 257 @issues.sort!
258 258 @copy = params[:copy].present?
259
259 260 attributes = parse_params_for_bulk_issue_attributes(params)
261 copy_subtasks = (params[:copy_subtasks] == '1')
262 copy_attachments = (params[:copy_attachments] == '1')
260 263
261 264 unsaved_issues = []
262 265 saved_issues = []
263 266
264 if @copy && params[:copy_subtasks].present?
267 if @copy && copy_subtasks
265 268 # Descendant issues will be copied with the parent task
266 269 # Don't copy them twice
267 270 @issues.reject! {|issue| @issues.detect {|other| issue.is_descendant_of?(other)}}
@@ -271,8 +274,8 class IssuesController < ApplicationController
271 274 orig_issue.reload
272 275 if @copy
273 276 issue = orig_issue.copy({},
274 :attachments => params[:copy_attachments].present?,
275 :subtasks => params[:copy_subtasks].present?
277 :attachments => copy_attachments,
278 :subtasks => copy_subtasks
276 279 )
277 280 else
278 281 issue = orig_issue
@@ -3866,7 +3866,7 class IssuesControllerTest < ActionController::TestCase
3866 3866
3867 3867 assert_difference 'Issue.count', 1 do
3868 3868 assert_no_difference 'Attachment.count' do
3869 post :bulk_update, :ids => [3], :copy => '1',
3869 post :bulk_update, :ids => [3], :copy => '1', :copy_attachments => '0',
3870 3870 :issue => {
3871 3871 :project_id => ''
3872 3872 }
@@ -3907,7 +3907,7 class IssuesControllerTest < ActionController::TestCase
3907 3907 @request.session[:user_id] = 2
3908 3908
3909 3909 assert_difference 'Issue.count', 1 do
3910 post :bulk_update, :ids => [issue.id], :copy => '1',
3910 post :bulk_update, :ids => [issue.id], :copy => '1', :copy_subtasks => '0',
3911 3911 :issue => {
3912 3912 :project_id => ''
3913 3913 }
General Comments 0
You need to be logged in to leave comments. Login now