Bug #2177
Plugin breaks the display of multi-select lists
100%
Description
Custom fields which have “Multiple values” checked will not display correctly if more than one value is selected. This will happen even if no additional “templating” has been enabled for the field via the extended fields plugin; simply loading this plugin will break the display of any multi-select list custom fields.
This can be observed with an issue custom field both on an individual issue page and the issue list.
On the issue page the array of values is printed without formatting “onetwothreefour” instead of with commas “one, two, three, four”.
On the issue list only the first value is shown “one” instead of “one, two, three, four”.
The following workaround appears to work. I’m not familiar enough with the plugin to know if this is the proper way to fix this:
--- extended-fields/lib/extended_fields_helper_patch.rb 2012-09-27 09:20:38.000000000 -0400
+++ extended_fields/lib/extended_fields_helper_patch.rb 2013-03-21 18:17:43.000000000 -0400
@@ -30,7 +30,7 @@
:request => request,
:custom_field => custom_value }))
else
- Redmine::CustomFieldFormat.format_value(custom_value.value, custom_value.custom_field.field_format)
+ format_value(custom_value.value, custom_value.custom_field.field_format)
end
end
end
diff -ru extended-fields/lib/extended_query_custom_field_column.rb extended_fields/lib/extended_query_custom_field_column.rb
--- extended-fields/lib/extended_query_custom_field_column.rb 2012-03-07 06:38:38.000000000 -0500
+++ extended_fields/lib/extended_query_custom_field_column.rb 2013-03-21 18:18:45.000000000 -0400
@@ -14,7 +14,8 @@
module InstanceMethods
def extended_value(issue)
- issue.custom_values.detect{ |value| value.custom_field_id == @cf.id }
+ cv = issue.custom_values.select{ |value| value.custom_field_id == @cf.id }
+ cv.size > 1 ? cv.sort {|a,b| a.to_s <=> b.to_s} : cv.first
end
end
Environment¶
- Redmine 2.2.3
- Extended Fields: 0.2.1
Related issues
Associated revisions
Applied patch for #2177 and refactored corresponding code, update French and added Italian
History
#1 Updated by Dipan Mehta over 11 years ago
Take a look at #2176. I have faced identical problem and also solved it myself. (Though I want more people to verify the patch I have given.
#2 Updated by Andriy Lesyuk over 11 years ago
- Status changed from New to Open
- Assignee set to Andriy Lesyuk
- Target version set to 0.2.2
Thanks!
#3 Updated by Andriy Lesyuk over 11 years ago
- Due date set to 02 Jun 2013
- Status changed from Open to Closed
- % Done changed from 0 to 100