hdgarrood / redmine_release_notes

A plugin to add release notes to Redmine
GNU General Public License v3.0
73 stars 47 forks source link

argument nil expected string #132

Closed mauro-miatello closed 4 years ago

mauro-miatello commented 4 years ago

suddenly, without update or changing anything, plugin stop working

Processing by VersionsController#show as HTML
  Parameters: {"id"=>"784"}
  Current user: miatello.mauro (id=47)
  Rendered versions/_overview.html.erb (4.1ms)
  Rendered versions/_issue_counts.html.erb (3.9ms)
  Rendered plugins/redmine_release_notes/app/views/release_notes/_dashboard.html.erb (15.9ms)
  Rendered plugins/redmine_release_notes/app/views/hooks/release_notes/_version_show_bottom.html.erb (16.8ms)
  Rendered versions/show.html.erb within layouts/base (50.5ms)
Completed 500 Internal Server Error in 79ms (ActiveRecord: 19.6ms)

ActionView::Template::Error (wrong argument type nil (expected String)):
    1: <% stats = version.release_notes_stats %>
    2: <% cf_none_value =  Setting.plugin_redmine_release_notes[:field_value_not_required] %>
    3: <% cf_name = CustomField.find_by_id(Setting.plugin_redmine_release_notes[:issue_custom_field_id]).name %> 
    4: 
  plugins/redmine_release_notes/lib/redmine_release_notes/issue_patch.rb:76:in `release_notes_not_required'
  plugins/redmine_release_notes/lib/redmine_release_notes/version_patch.rb:39:in `release_notes_stats'
  plugins/redmine_release_notes/app/views/release_notes/_dashboard.html.erb:1:in `_f90aca0f1343703bd51b949bf8d85ee0'
  plugins/redmine_release_notes/app/views/hooks/release_notes/_version_show_bottom.html.erb:7:in `_0a45ba66ce649c54abdd49dede47dde6'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  app/views/versions/show.html.erb:54:in `_6834c25188abf7ffae64907b863fe25a'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

I've also tried to update redmine to 2.4.11 or use some or forked projects, without success

mauro-miatello commented 4 years ago

i think the issue is about <% stats = version.release_notes_stats %> in plugins/redmine_release_notes/app/views/release_notes/_dashboard.html.erb

in lib/redmine_release_notes/version_patch.rb there is the class def

mauro-miatello commented 4 years ago

solved

  1. removed line name = "plugin_redmine_release_notes" from redmine settings table
  2. imported from a backup done with mydqldump
  3. restarted apache

the problem was that modifying module settings something changed, and I cant restore re-settings it manually like before. also, not even copy and paste worked! I have to import backup file, probably something is broken with new line carriage / layout character / locales / collation