diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 11:56:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-06 11:56:30 +0000 |
commit | 07d20cc5f70b55787296539276f198cc47004ae7 (patch) | |
tree | dc9bfaf1402d0d3fc5b3f7182db25b6dca2627e9 /app/controllers/issues_controller.rb | |
parent | dee17f4677498a8e3e81beac0622762165fa129d (diff) | |
download | redmine-07d20cc5f70b55787296539276f198cc47004ae7.tar.gz redmine-07d20cc5f70b55787296539276f198cc47004ae7.zip |
Let non required list/user/version custom fields to be set to blank when bulk editing (#10605).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9349 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r-- | app/controllers/issues_controller.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index f8d982c12..5621fbbe8 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -420,7 +420,16 @@ private def parse_params_for_bulk_issue_attributes(params) attributes = (params[:issue] || {}).reject {|k,v| v.blank?} attributes.keys.each {|k| attributes[k] = '' if attributes[k] == 'none'} - attributes[:custom_field_values].reject! {|k,v| v.blank?} if attributes[:custom_field_values] + if custom = attributes[:custom_field_values] + custom.reject! {|k,v| v.blank?} + custom.keys.each do |k| + if custom[k].is_a?(Array) + custom[k] << '' if custom[k].delete('__none__') + else + custom[k] = '' if custom[k] == '__none__' + end + end + end attributes end end |