summaryrefslogtreecommitdiffstats
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-08 09:07:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-03-08 09:07:20 +0000
commit76a4668f52b32b5e2e4a84d02b7ef1d15bbb9ffc (patch)
tree391940eb27fff8049fddee8f9c844ac7c909d01a /app/helpers/issues_helper.rb
parent730bba8130ba72d6c6d01edc5712169068d67ba7 (diff)
downloadredmine-76a4668f52b32b5e2e4a84d02b7ef1d15bbb9ffc.tar.gz
redmine-76a4668f52b32b5e2e4a84d02b7ef1d15bbb9ffc.zip
Fixed rendering of multivalued custom fields in the issue history (#19225).
git-svn-id: http://svn.redmine.org/redmine/trunk@14054 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 3870a066d..8e951596c 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -320,15 +320,19 @@ module IssuesHelper
end
strings << show_detail(detail, no_html, options)
end
- values_by_field.each do |field, changes|
- detail = JournalDetail.new(:property => 'cf', :prop_key => field.id.to_s)
- detail.instance_variable_set "@custom_field", field
- if changes[:added].any?
- detail.value = changes[:added]
- strings << show_detail(detail, no_html, options)
- elsif changes[:deleted].any?
- detail.old_value = changes[:deleted]
- strings << show_detail(detail, no_html, options)
+ if values_by_field.present?
+ multiple_values_detail = Struct.new(:property, :prop_key, :custom_field, :old_value, :value)
+ values_by_field.each do |field, changes|
+ if changes[:added].any?
+ detail = multiple_values_detail.new('cf', field.id.to_s, field)
+ detail.value = changes[:added]
+ strings << show_detail(detail, no_html, options)
+ end
+ if changes[:deleted].any?
+ detail = multiple_values_detail.new('cf', field.id.to_s, field)
+ detail.old_value = changes[:deleted]
+ strings << show_detail(detail, no_html, options)
+ end
end
end
strings