diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/application_controller.rb | 12 | ||||
-rw-r--r-- | app/controllers/issues_controller.rb | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f907b1159..f671d87f7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -413,10 +413,18 @@ class ApplicationController < ActionController::Base def parse_params_for_bulk_update(params) attributes = (params || {}).reject {|k, v| v.blank?} - attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'} if custom = attributes[:custom_field_values] custom.reject! {|k, v| v.blank?} - custom.keys.each do |k| + end + + replace_none_values_with_blank(attributes) + end + + def replace_none_values_with_blank(params) + attributes = (params || {})) + attributes.each_key {|k| attributes[k] = '' if attributes[k] == 'none'} + if (custom = attributes[:custom_field_values]) + custom.each_key do |k| if custom[k].is_a?(Array) custom[k] << '' if custom[k].delete('__none__') else diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 080520ef5..96a8341d0 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -561,6 +561,7 @@ class IssuesController < ApplicationController return false end end + issue_attributes = replace_none_values_with_blank(issue_attributes) @issue.safe_attributes = issue_attributes @priorities = IssuePriority.active @allowed_statuses = @issue.new_statuses_allowed_to(User.current) |