Defect #16926

Custom field referencing deleted value trigger an error on display

Added by nicolas felix over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Custom fields
Target version:2.5.2
Resolution:Fixed Affected version:2.5.0

Description

Hi Redmine team !
our redmine environment holds more than 14k issues,
we are using it for a while now (about 4 years I think),
I want to thank you for this project !

Here, I am facing to an exception while trying to display a specific issue (Id 11011).
I don't understand why, as it worked a month ago, and we don't change anything on the server (no upgrade, no new plugin).

Here the logs


Started GET "/redmine/issues/11011" for 127.0.0.1 at 2014-05-20 08:08:09 +0200
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"11011"}
  Current user: n.felix (id=21)
  Rendered issues/_action_menu.html.erb (93.8ms)
  Rendered issues/show.html.erb within layouts/base (296.9ms)
Completed 500 Internal Server Error in 984.4ms

ActionView::Template::Error (undefined method `effective_date' for nil:NilClass):
    64:     rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), project_issue_time_entries_path(@project, @issue)) : "-"), :class => 'spent-time'
    65:   end
    66: end %>
    67: <%= render_custom_fields_rows(@issue) %>
    68: <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
    69: </table>
    70: 
  app/models/version.rb:183:in `<=>'
  lib/redmine/field_format.rb:101:in `sort'
  lib/redmine/field_format.rb:101:in `cast_value'
  lib/redmine/field_format.rb:150:in `formatted_value'
  lib/redmine/field_format.rb:146:in `formatted_custom_value'
  app/helpers/application_helper.rb:187:in `format_object'
  app/helpers/custom_fields_helper.rb:107:in `show_value'
  app/helpers/issues_helper.rb:176:in `block in render_custom_fields_rows'
  app/helpers/issues_helper.rb:173:in `each'
  app/helpers/issues_helper.rb:173:in `render_custom_fields_rows'
  app/views/issues/show.html.erb:67:in `_app_views_issues_show_html_erb___497937765_24444252'
  app/controllers/issues_controller.rb:128:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:125:in `show'

and the configuration

Environment:
  Redmine version                2.5.0.stable
  Ruby version                   1.9.3-p231 (2012-05-25) [i386-mingw32]
  Rails version                  3.2.17
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.6.19
  Git                            1.8.5.2
  Filesystem                     
Redmine plugins:
  redmine_theme_changer          0.1.0

Have you any idea about the issue source ?
At least, any way to bypass this issue (database update, manual patch...)

Thanks for any help.
Regards,
Nicolas

Associated revisions

Revision 13141
Added by Jean-Philippe Lang over 3 years ago

Fixed that custom field referencing deleted value trigger an error on display (#16926).

History

#1 Updated by Toshi MARUYAMA over 3 years ago

  • Category set to Custom fields

#2 Updated by Toshi MARUYAMA over 3 years ago

  • Target version set to 2.5.2

#3 Updated by Jean-Philippe Lang over 3 years ago

  • Subject changed from Internal Server Error while accessing a specific issue. to Custom field referencing deleted value trigger an error on display
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r13141, thanks for pointing this out.

#4 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from Resolved to Closed

Merged.

#5 Updated by nicolas felix over 3 years ago

Jean-Philippe Lang wrote:

Fixed in r13141, thanks for pointing this out.

Thanks to you, Jean-Philippe.
I successfully applied the patch on my 2.5.0 environment.

Also available in: Atom PDF