I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Bug #2177

Plugin breaks the display of multi-select lists

Added by Eric Mills about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
21 Mar 2013
Due date:
02 Jun 2013
% Done:

100%

Redmine version:
2.2.3
External issue:

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

Related to Extended Fields - Bug #2176: Rendering of multi-select custom fields User and Version produces error Closed 17 Mar 2013 02 Jun 2013

Associated revisions

Revision 89 (diff)
Added by Andriy Lesyuk almost 11 years ago

Applied patch for #2177 and refactored corresponding code, update French and added Italian

History

#1 Updated by Dipan Mehta about 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 almost 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 almost 11 years ago

  • Due date set to 02 Jun 2013
  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF

Terms of use | Privacy policy