agileware-jp / redmine_issue_templates

Redmine Issue Template. Pull requests, reporting issues, stars and sponsoring are always welcome!
https://www.redmine.org/plugins/redmine_issue_templates
GNU General Public License v2.0
65 stars 28 forks source link

Redmine 5.0 on Debian Bookworm: “Tried to load unspecified class: ActionController::Parameters” #60

Closed albrechtd closed 1 year ago

albrechtd commented 1 year ago

Summary

The plugin can be installed on Debian Bookworm (aka testing), but using it fails with error

ActionView::Template::Error (Tried to load unspecified class: ActionController::Parameters):

Description

The plugin can be installed, but any operation dealing with templates (i.e. creating a new ticket, trying to edit a template, …) produces errors as in the log snippet below, and an error page in the browser.

Please note that the database contents is actually a “cleaned” import from Redmine 4 (i.e. the table contents has been updated regarding the differences between Redmine 4 and 5, but the DB Schema is of course the original one from Redmine 5). As I had several other plugins installed on Redmine 4, the data produced by them is still in the (imported) database. However, for this test I removed all plugin folders (from usr/share/redmine/plugins) except for the issue templates, but did not remove related data from the database. I don't think this would make a difference, though.

Environment

These informations are greatly helpful to support quickly. You can get these informations from Redmine's information page.

Environment:
  Redmine version                5.0.4.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux-gnu]
  Rails version                  6.1.7
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Git                            2.39.2
  Filesystem                     
Redmine plugins:
  redmine_issue_templates        1.1.1

Visual Proof / Screenshot

When reporting an application error, post the error stack trace that you should find in the log file (eg. log/production.log).

[0cb62655-fbe6-4cc5-944d-751db5148812] ActionView::Template::Error (Tried to load unspecified class: ActionController::Parameters):
[0cb62655-fbe6-4cc5-944d-751db5148812]     1: <%= labelled_fields_for :issue, @issue do |f| %>
[0cb62655-fbe6-4cc5-944d-751db5148812]     2: <%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
[0cb62655-fbe6-4cc5-944d-751db5148812]     3: <%= hidden_field_tag 'form_update_triggered_by', '' %>
[0cb62655-fbe6-4cc5-944d-751db5148812]     4: <%= hidden_field_tag 'back_url', params[:back_url], :id => nil if params[:back_url].present? %>
[0cb62655-fbe6-4cc5-944d-751db5148812]     5: 
[0cb62655-fbe6-4cc5-944d-751db5148812]   
[0cb62655-fbe6-4cc5-944d-751db5148812] app/models/setting.rb:111:in `value'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/models/setting.rb:125:in `[]'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/models/setting.rb:320:in `plugin_redmine_issue_templates'
[0cb62655-fbe6-4cc5-944d-751db5148812] plugins/redmine_issue_templates/lib/issue_templates/issues_hook.rb:70:in `plugin_setting'
[0cb62655-fbe6-4cc5-944d-751db5148812] plugins/redmine_issue_templates/lib/issue_templates/issues_hook.rb:78:in `apply_template_when_edit_issue?'
[0cb62655-fbe6-4cc5-944d-751db5148812] plugins/redmine_issue_templates/lib/issue_templates/issues_hook.rb:43:in `existing_issue?'
[0cb62655-fbe6-4cc5-944d-751db5148812] plugins/redmine_issue_templates/lib/issue_templates/issues_hook.rb:24:in `view_issues_form_details_top'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/hook.rb:66:in `block (2 levels) in call_hook'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/hook.rb:66:in `each'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/hook.rb:66:in `block in call_hook'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/hook.rb:63:in `call_hook'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/hook.rb:101:in `call_hook'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/views/issues/_form.html.erb:2
[0cb62655-fbe6-4cc5-944d-751db5148812] app/helpers/application_helper.rb:1490:in `labelled_fields_for'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/views/issues/_form.html.erb:1
[0cb62655-fbe6-4cc5-944d-751db5148812] app/views/issues/new.html.erb:11
[0cb62655-fbe6-4cc5-944d-751db5148812] app/helpers/application_helper.rb:1483:in `labelled_form_for'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/views/issues/new.html.erb:5
[0cb62655-fbe6-4cc5-944d-751db5148812] app/controllers/issues_controller.rb:138:in `block (2 levels) in new'
[0cb62655-fbe6-4cc5-944d-751db5148812] app/controllers/issues_controller.rb:137:in `new'
[0cb62655-fbe6-4cc5-944d-751db5148812] lib/redmine/sudo_mode.rb:61:in `sudo_mode'

Expected Results

Plugin should work as with Redmine 4 on Debian Buster.

Actual Results

See above.

Workaround

Unfortunately not…

github-actions[bot] commented 1 year ago

Thank you for contributing to Redmine Issue Templates plugin!' first issue

albrechtd commented 1 year ago

I found a workaround (which may actually be the solution, see Redmine issue 37719 re. the background):

Edit the file /usr/share/redmine/config/application.rb, and add ActionController::Parameters to the array config.active_record.yaml_column_permitted_classes.

Now the plugin works with Redmine 5 on Bookworm…