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

Error in issue list with absent custom field

Added by Sergey B almost 10 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
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

  1. Create custom field ABC of type TEXT for tracker Feature. Don’t include new field into other trackers.
  2. Open issue list
  3. Add custom field ABC to selected columns
  4. Specify filter to find any issue with tracker Bug
  5. Click apply

Expected behaviour

  1. Issue list is displayed with empty column ABC for Bugs

Actual behaviour

  1. 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

Duplicates Extended Fields - Patch #2294: Error 500 with version 0.2.3 on Redmine 2.5.1 Closed 22 May 2014

Associated revisions

Revision 125 (diff)
Added by Andriy Lesyuk about 8 years ago

Applied patch of Massimo Rossello (#2294, #2314 and #2366)

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

Also available in: Atom PDF

Terms of use | Privacy policy