summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/issues_controller.rb2
-rw-r--r--test/functional/issues_controller_test.rb11
2 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index d38b69dd1..c314b7809 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -229,7 +229,7 @@ class IssuesController < ApplicationController
else
@available_statuses = @issues.map(&:new_statuses_allowed_to).reduce(:&)
end
- @custom_fields = target_projects.map{|p|p.all_issue_custom_fields.visible}.reduce(:&)
+ @custom_fields = @issue..map{|p|p.all_issue_custom_fields.visible}.reduce(:&)
@assignables = target_projects.map(&:assignable_users).reduce(:&)
@trackers = target_projects.map(&:trackers).reduce(:&)
@versions = target_projects.map {|p| p.shared_versions.open}.reduce(:&)
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index dc3bd4861..cab533138 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -3536,6 +3536,17 @@ class IssuesControllerTest < ActionController::TestCase
end
end
+ def test_bulk_edit_should_only_propose_issues_trackers_custom_fields
+ IssueCustomField.delete_all
+ field = IssueCustomField.generate!(:tracker_ids => [1], :is_for_all => true)
+ IssueCustomField.generate!(:tracker_ids => [2], :is_for_all => true)
+ @request.session[:user_id] = 2
+
+ issue_ids = Issue.where(:project_id => 1, :tracker_id => 1).limit(2).ids
+ get :bulk_edit, :ids => issue_ids
+ assert_equal [field], assigns(:custom_fields)
+ end
+
def test_bulk_update
@request.session[:user_id] = 2
# update issues priority