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 #2176

Rendering of multi-select custom fields User and Version produces error

Added by Dipan Mehta almost 12 years ago. Updated over 11 years ago.

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

100%

Redmine version:
2.2.3
External issue:

Description

I have installed extended fields 0.2.1 on Redmine 2.2.3.

Upon creating a custom field of type “User” of multiple select option, produces the error.
At first I had filed the issue on Redmine Issue #13495 But upon more testing I found that the issue didn’t exist on plain Redmine, but when only Extended fields plug-in was used.

My environment is:
Ruby version 1.9.3 (i686-linux)
RubyGems version 1.8.25
Rack version 1.4
Rails version 3.2.12
Active Record version 3.2.12
Action Pack version 3.2.12
Active Resource version 3.2.12
Action Mailer version 3.2.12
Active Support version 3.2.12
Middleware Rack::Cache, ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0xa52f6ac>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, OpenIdAuthentication
Application root /usr/local/share/redmine-2.2.3
Environment production
Database adapter mysql2
Database schema version 20121026003537

I am attaching the exact logs as well.

with-ext-fields-redmine_app.log View (15 KB) Dipan Mehta, 17 Mar 2013 12:15

patch-2176.diff View (1.06 KB) Dipan Mehta, 20 Mar 2013 06:42


Related issues

Related to Extended Fields - Bug #2177: Plugin breaks the display of multi-select lists Closed 21 Mar 2013 02 Jun 2013

History

#1 Updated by Dipan Mehta almost 12 years ago

I am attaching the log where it shows

ActionView::Template::Error (undefined method `to_i' for ["6", "15"]:Array)

This comes from a custom field of type user:
On issue 1144

mysql> select * from custom_values where (value="6" OR value="15") AND customized_id=1144;
+-------+-----------------+---------------+-----------------+-------+
| id    | customized_type | customized_id | custom_field_id | value |
+-------+-----------------+---------------+-----------------+-------+
| 18055 | Issue           |          1144 |              76 | 6     |
| 18057 | Issue           |          1144 |              76 | 15    |
+-------+-----------------+---------------+-----------------+-------+
mysql> select id,type,name,field_format,multiple from custom_fields where id=76;
+----+------------------+---------------+--------------+----------+
| id | type             | name          | field_format | multiple |
+----+------------------+---------------+--------------+----------+
| 76 | IssueCustomField | People_list_i | user         |        1 |
+----+------------------+---------------+--------------+----------+

The same situation exists when the field type is “Version” - and the issue applies to custom field on any resource including Issue, Version, or Project.

Dipan.

#2 Updated by Dipan Mehta almost 12 years ago

Looks like I have cracked the issue.

The bug lies in the

/lib/extended_fields_helper_patch.rb: line33
which says.
Redmine::CustomFieldFormat.format_value(custom_value.value, field_format)

At this point before calling the format_value, we should check if the value is Array or not.

I have added a small patch which resolves this. Will you validate and accept it?

Dipan.

#3 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
  • % Done changed from 0 to 100

Many thanks!

#4 Updated by Andriy Lesyuk over 11 years ago

  • % Done changed from 100 to 0

#5 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

Also available in: Atom PDF

Terms of use | Privacy policy