TravisSpangle / redmine_spent_time_in_issue_description

Redmine Plugin that drops Time Entry data into the Issue Description
16 stars 17 forks source link

Broken with Redmine 3.2.0 - ActionView::Template::Error (undefined method `include?' for nil:NilClass) #34

Closed sammcj closed 8 years ago

sammcj commented 8 years ago

I just updated our dev instance to Redmine 3.2.0 and found that when you go to log time against a ticket you get a 500 error:

Started POST "/time_entries" for 172.17.0.1 at 2015-12-10 18:43:59 +1100
Processing by TimelogController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"secret", "back_url"=>"https://my.redmine.url/issues/84871", "issue_id"=>"84871", "time_entry"=>{"issue_id"=>"84871", "spent_on"=>"2015-12-10", "hours"=>"1", "comments"=>"", "activity_id"=>"460"}, "commit"=>"Create"}
  Current user: samm (id=303)
Redirected to https://my.redmine.url/issues/84871
Completed 302 Found in 51ms (ActiveRecord: 25.1ms)
Started GET "/issues/84871" for 172.17.0.1 at 2015-12-10 18:43:59 +1100
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"84871"}
  Current user: samm (id=303)
  Rendered issues/_action_menu.html.erb (11.6ms)
  Rendered plugins/redmine_contacts/app/views/deals_issues/_show.html.erb (43.3ms)
  Rendered plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data.html.erb (1.7ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist.html.erb (13.6ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/_time_spent_report.html.erb (4.0ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/show.html.erb within layouts/base (146.1ms)
Completed 500 Internal Server Error in 670ms (ActiveRecord: 129.2ms)

ActionView::Template::Error (undefined method `include?' for nil:NilClass):
     9: <table class="issue-spent-time-description">
    10:   <thead>
    11:     <% %w( spentOn user hours comments activity).each do |column_value| %>
    12:       <%= content_tag(:th, t("plugin_spent_time_in_issue." << column_value ) ) if Setting.plugin_redmine_spent_time_in_issue_description['display_columns'].include? column_value %>
    13:     <%end %>
    14:     <%= content_tag(:th ) %>
    15:   </thead>
  app/controllers/issues_controller.rb:118:in `block (2 levels) in show'
  app/controllers/issues_controller.rb:115:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
TravisSpangle commented 8 years ago

This is a duplicate of #12 - please confirm if 'display_columns' has been configured in your settings?

sammcj commented 8 years ago

OK yes that fixed it. Perhaps it should be set to something by default?

TravisSpangle commented 8 years ago

It defaults to 4 of the columns, you may be on an older version.