Bug #2366
Error in issue list with absent custom field
Start date:
18 Mar 2015
Due date:
% Done:
0%
Redmine version:
2.5.1
External issue:
Description
Error in issue list with absent custom field
Steps to reproduce¶
- Create custom field ABC of type TEXT for tracker Feature. Don’t include new field into other trackers.
- Open issue list
- Add custom field ABC to selected columns
- Specify filter to find any issue with tracker Bug
- Click apply
Expected behaviour¶
- Issue list is displayed with empty column ABC for Bugs
Actual behaviour¶
- Error 500
Details from logs¶
ActionView::Template::Error (undefined method `value' for nil:NilClass): 48: <% if Redmine::VERSION::MAJOR < 2 || Redmine::VERSION::MINOR < 3 || defined?(ChiliProject) %> 49: <td class="id"><%= link_to issue.to_param, :controller => 'issues', :action => 'show', :id => issue %></td> 50: <% end %> 51: <% inline_columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.respond_to?(:css_classes) ? column.css_classes : column.name %><% end %> 52: </tr> 53: <% if @query.respond_to?(:block_columns) %> 54: <% @query.block_columns.each do |column| app/helpers/issues_helper.rb:29:in `block in issue_list' app/helpers/issues_helper.rb:25:in `each' app/helpers/issues_helper.rb:25:in `issue_list' app/views/issues/index.html.erb:63:in `_app_views_issues_index_html_erb__170430936_35670624' app/controllers/issues_controller.rb:87:in `block (2 levels) in index' app/controllers/issues_controller.rb:86:in `index'
Related issues
Associated revisions
History
#1 Updated by Jacek Pasternak almost 10 years ago
Same bug with Redmine 2.5.3.
#2 Updated by Jacek Pasternak over 9 years ago
I’ve found quick fix for this in lib/extended_queries_helper_patch.rb:
diff -r -u 0.2.3/extended_fields/lib/extended_queries_helper_patch.rb 0.2.3_fixed/extended_fields/lib/extended_queries_helper_patch.rb --- 0.2.3/extended_fields/lib/extended_queries_helper_patch.rb Sun May 11 22:22:45 2014 +++ 0.2.3_fixed/extended_fields/lib/extended_queries_helper_patch.rb Tue Mar 24 14:52:10 2015 @@ -24,7 +24,7 @@ if column.custom_field.visible_by?(issue.project, User.current) value = issue.custom_field_values.detect{ |value| value.custom_field_id == column.custom_field.id } - h(show_value(value)) + value.nil? ? '' : h(show_value(value)) else nil end
It works for me.
#3 Updated by Sergey B over 9 years ago
The patch above works for me too. Thanks a lot.
#4 Updated by Andriy Lesyuk about 9 years ago
- Status changed from New to Open
- Assignee set to Andriy Lesyuk
#5 Updated by Andriy Lesyuk about 8 years ago
- Duplicates Patch #2294: Error 500 with version 0.2.3 on Redmine 2.5.1 added
#6 Updated by Andriy Lesyuk about 8 years ago
- Status changed from Open to Closed