ixti / redmine_tags

Redmine plugin, that adds issues tagging support
GNU General Public License v3.0
196 stars 119 forks source link

Error rendering template after upgrade to 4.0.0 #208

Closed PYushchenko closed 5 years ago

PYushchenko commented 5 years ago
Environment:
  Redmine version                4.0.0.stable
  Ruby version                   2.3.8-p459 (2018-10-18) [x86_64-linux-gnu]
  Rails version                  5.2.2
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
SCM:
  Subversion                     1.9.3
  Mercurial                      3.7.3
  Cvs                            1.12.13
  Bazaar                         2.7.0
  Git                            2.20.1
  Filesystem                     
Redmine plugins:
  redmine_omniauth_google        0.0.1
  redmine_tags                   4.0.0

production.log

Started GET "/projects/development/issues" for * at 2019-01-18 16:54:44 +0000
Processing by IssuesController#index as HTML
  Parameters: {"project_id"=>"development"}
  Current user: yushchenko (id=5)
  Rendering issues/index.html.erb within layouts/base
  Rendered queries/_filters.html.erb (13.8ms)
  Rendered queries/_columns.html.erb (1.8ms)
  Rendered queries/_query_form.html.erb (18.1ms)
  Rendered issues/_list.html.erb (31.8ms)
  Rendered plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb (0.8ms)
  Rendered issues/_sidebar.html.erb (1.3ms)
  Rendered issues/index.html.erb within layouts/base (60.1ms)
Completed 500 Internal Server Error in 125ms (ActiveRecord: 25.6ms)

ActionView::Template::Error (undefined method `with_indifferent_access' for #<ActionController::Parameters:0x0000000003e30b68>):
    1: <% if defined?(sidebar_tags) && !sidebar_tags.empty? && !@issue %>
    2:   <%= stylesheet_link_tag 'jquery.tagit.css', plugin: 'redmine_tags' %>
    3:   <%= stylesheet_link_tag 'redmine_tags', plugin: 'redmine_tags' %>
    4:   <h3><%= l :tags %></h3>

plugins/redmine_tags/lib/redmine_tags.rb:3:in `new'
plugins/redmine_tags/lib/redmine_tags.rb:3:in `settings'
plugins/redmine_tags/app/helpers/issues_tags_helper.rb:5:in `sidebar_tags'
plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb:1:in `_plugins_redmine_tags_app_views_issues__tags_sidebar_html_erb___4012980445424777199_67501980'
lib/redmine/hook/view_listener.rb:59:in `block (2 levels) in render_on'
lib/redmine/hook/view_listener.rb:57:in `map'
lib/redmine/hook/view_listener.rb:57:in `block in render_on'
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/issues/_sidebar.html.erb:15:in `_app_views_issues__sidebar_html_erb__3418756092313957964_67462320'
app/views/issues/index.html.erb:58:in `block in _app_views_issues_index_html_erb___4475355278363679554_66307320'
app/views/issues/index.html.erb:57:in `_app_views_issues_index_html_erb___4475355278363679554_66307320'
app/controllers/issues_controller.rb:52:in `block (2 levels) in index'
app/controllers/issues_controller.rb:47:in `index'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'

bundle info

Gems included by the bundle:
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
  * actioncable (5.2.2)
  * actionmailer (5.2.2)
  * actionpack (5.2.2)
  * actionpack-xml_parser (2.0.1)
  * actionview (5.2.2)
  * activejob (5.2.2)
  * activemodel (5.2.2)
  * activerecord (5.2.2)
  * activestorage (5.2.2)
  * activesupport (5.2.2)
  * acts-as-taggable-on (6.0.0)
  * addressable (2.6.0)
  * arel (9.0.0)
  * builder (3.2.3)
  * bundler (2.0.1)
  * concurrent-ruby (1.1.4)
  * crass (1.0.4)
  * css_parser (1.6.0)
  * csv (3.0.3)
  * dalli (2.7.9)
  * erubi (1.8.0)
  * faraday (0.15.4)
  * globalid (0.4.2)
  * htmlentities (4.3.4)
  * i18n (0.7.0)
  * json (2.1.0)
  * jwt (2.1.0)
  * kgio (2.11.2)
  * loofah (2.2.3)
  * mail (2.7.1)
  * marcel (0.3.3)
  * method_source (0.9.2)
  * mimemagic (0.3.3)
  * mini_mime (1.0.1)
  * mini_portile2 (2.3.0)
  * minitest (5.11.3)
  * multi_json (1.13.1)
  * multi_xml (0.6.0)
  * multipart-post (2.0.0)
  * mysql2 (0.5.2)
  * net-ldap (0.16.1)
  * nio4r (2.3.1)
  * nokogiri (1.8.5)
  * oauth2 (1.4.1)
  * pg (1.0.0)
  * public_suffix (3.0.3)
  * rack (2.0.6)
  * rack-openid (1.4.2)
  * rack-test (1.1.0)
  * rails (5.2.2)
  * rails-dom-testing (2.0.3)
  * rails-html-sanitizer (1.0.4)
  * railties (5.2.2)
  * raindrops (0.19.0)
  * rake (12.3.2)
  * rbpdf (1.19.6)
  * rbpdf-font (1.19.1)
  * redcarpet (3.4.0)
  * request_store (1.0.5)
  * rmagick (2.16.0)
  * roadie (3.4.0)
  * roadie-rails (1.3.0)
  * rouge (3.3.0)
  * ruby-openid (2.3.0)
  * sprockets (3.7.2)
  * sprockets-rails (3.2.1)
  * thor (0.20.3)
  * thread_safe (0.3.6)
  * tzinfo (1.2.5)
  * unicorn (5.4.1)
  * websocket-driver (0.7.0)
  * websocket-extensions (0.1.3)
amousset commented 5 years ago

This appears to be a settings migration issue, I could fix it by removing old settings from the database (with delete from settings where name = "plugin_redmine_tags";) and letting the 4.0 plugin recreate them.

Previous settings were:

+----+---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+
| id | name                | value                                                                                                                                                                | updated_on          |
+----+---------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+
| 65 | plugin_redmine_tags | --- !ruby/hash:ActionController::Parameters
issues_sidebar: simple_cloud
issues_show_count: '1'
issues_open_only: '1'
issues_sort_by: count
issues_sort_order: desc
 | 2015-12-30 17:17:02 |

while the new value starts with !ruby/hash:ActiveSupport::HashWithIndifferentAccess which seems to make it work.

PYushchenko commented 5 years ago

Yup, fixed.

Thank you!

janekska commented 3 years ago

+1 This fixed my problem too.