]> source.dussan.org Git - redmine.git/commitdiff
Fixed: issue status bulk edit broken by r2726 (#3347).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 14 May 2009 18:18:29 +0000 (18:18 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 14 May 2009 18:18:29 +0000 (18:18 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2744 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
test/functional/issues_controller_test.rb

index 06a654b2487f98633530c23f5418a2b9024e3d70..e49a3ecb75b68ca6f23b7d71ca8fc81f6e2ed796 100644 (file)
@@ -256,7 +256,7 @@ class IssuesController < ApplicationController
         issue.custom_field_values = custom_field_values if custom_field_values && !custom_field_values.empty?
         call_hook(:controller_issues_bulk_edit_before_save, { :params => params, :issue => issue })
         # Don't save any change to the issue if the user is not authorized to apply the requested status
-        unless (status.nil? || (issue.status.new_status_allowed_to?(status, current_role, issue.tracker) && issue.status = status)) && issue.save
+        unless (status.nil? || (issue.new_statuses_allowed_to(User.current).include?(status) && issue.status = status)) && issue.save
           # Keep unsaved issue ids to display them in flash error
           unsaved_issue_ids << issue.id
         end
index f47e384a5064be14252befcecdcc315a61a72020..ff132669d778761a492c79b3d3ad85e092835fa4 100644 (file)
@@ -873,6 +873,18 @@ class IssuesControllerTest < Test::Unit::TestCase
     assert_equal 2, ActionMailer::Base.deliveries.size
   end
 
+  def test_bulk_edit_status
+    @request.session[:user_id] = 2
+    # update issues priority
+    post :bulk_edit, :ids => [1, 2], :priority_id => '',
+                                     :assigned_to_id => '',
+                                     :status_id => '5',
+                                     :notes => 'Bulk editing status'
+    assert_response 302
+    issue = Issue.find(1)
+    assert issue.closed?
+  end
+
   def test_bulk_edit_custom_field
     @request.session[:user_id] = 2
     # update issues priority