TravisSpangle / redmine_spent_time_in_issue_description

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

Plugin causes crash - display_columns returning nil #32

Open sammcj opened 9 years ago

sammcj commented 9 years ago
Started GET "/issues/83317" for 127.0.0.1 at 2015-10-05 15:25:42 +1100
Processing by IssuesController#show as HTML
  Parameters: {"id"=>"83317"}
  Current user: samm (id=303)
  Rendered issues/_action_menu.html.erb (11.2ms)
  Rendered plugins/redmine_contacts/app/views/deals_issues/_show.html.erb (37.7ms)
  Rendered plugins/redmine_contacts_helpdesk/app/views/issues/_ticket_data.html.erb (1.8ms)
  Rendered plugins/redmine_checklists/app/views/issues/_checklist.html.erb (11.0ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/_time_spent_report.html.erb (2.9ms)
  Rendered plugins/redmine_spent_time_in_issue_description/app/views/issues/show.html.erb within layouts/base (136.0ms)
Completed 500 Internal Server Error in 385ms (ActiveRecord: 75.4ms)

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'
sammcj commented 9 years ago

cc/ @greyman888

sammcj commented 9 years ago

Apparently "You can work around the issue by going to the admin panel > Plugins > Issue Description with Spent Time and selected the columns we want to be displayed in the ticket(s)"

TravisSpangle commented 9 years ago

The value display_columns is setup by default during installation, https://github.com/TravisSpangle/redmine_spent_time_in_issue_description/blob/master/init.rb.

As you noted it would be resolved by going to the configuration panel and saving any values in the display columns.

Can you verify if any of the default values were set in the configuration panel?