alphanodes / additional_tags

Redmine Plugin for adding tags functionality to issues and wiki pages.
https://www.redmine.org/plugins/additional_tags
GNU General Public License v2.0
64 stars 26 forks source link

ActionView::Template::Error after successful installation #60

Closed pkoevesdi closed 1 year ago

pkoevesdi commented 1 year ago

After installing this plugin (seemingly successful) I get an internal server error as soon as I try to view the sidebar with "show tags in sidebar" enabled. If I switch that off, I can at least view the redmine pages again, but still I cannot add any new tags (permissons on the groups and roles page are set). It says "The results cannot be loaded". In the database the additional_taggingsand additional_tags tables are there and empty. This is the content of the log when having the mentioned internal server error:

I, [2023-11-22T16:52:37.116132 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7] Started GET "/issues/5422" for 10.172.11.80 at 2023-11-22 16:52:37 +0100
I, [2023-11-22T16:52:37.117229 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7] Processing by IssuesController#show as HTML
I, [2023-11-22T16:52:37.117313 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7]   Parameters: {"id"=>"5422"}
I, [2023-11-22T16:52:37.126015 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7]   Current user: p.koevesdi (id=5)
I, [2023-11-22T16:52:37.331352 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7]   Rendered issues/show.html.erb within layouts/base (Duration: 128.9ms | Allocations: 55541)
I, [2023-11-22T16:52:37.331433 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7]   Rendered layout layouts/base.html.erb (Duration: 129.0ms | Allocations: 55584)
I, [2023-11-22T16:52:37.331633 #46834]  INFO -- : [500c38a3-4286-46f6-b92e-8afdafb2add7] Completed 500 Internal Server Error in 214ms (ActiveRecord: 45.8ms | Allocations: 72166)
F, [2023-11-22T16:52:37.332630 #46834] FATAL -- : [500c38a3-4286-46f6-b92e-8afdafb2add7]
[500c38a3-4286-46f6-b92e-8afdafb2add7] ActionView::Template::Error (Array::ArrayRowIsNotAHash):
[500c38a3-4286-46f6-b92e-8afdafb2add7]     1: - if AdditionalTags.setting?(:active_issue_tags) && \
[500c38a3-4286-46f6-b92e-8afdafb2add7]     2:      User.current.allowed_to?(:view_issue_tags, @project, global: true) && \
[500c38a3-4286-46f6-b92e-8afdafb2add7]     3:      defined?(sidebar_tags) && \
[500c38a3-4286-46f6-b92e-8afdafb2add7]     4:      sidebar_tags.present?
[500c38a3-4286-46f6-b92e-8afdafb2add7]     5:
[500c38a3-4286-46f6-b92e-8afdafb2add7]     6:   .sidebar-tags
[500c38a3-4286-46f6-b92e-8afdafb2add7]     7:     h3 = l :field_tags
[500c38a3-4286-46f6-b92e-8afdafb2add7]
[500c38a3-4286-46f6-b92e-8afdafb2add7] plugins/additional_tags/lib/additional_tags/tags.rb:149:in `table_columns'
[500c38a3-4286-46f6-b92e-8afdafb2add7] plugins/additional_tags/lib/additional_tags/tags.rb:35:in `available_tags'
[500c38a3-4286-46f6-b92e-8afdafb2add7] plugins/additional_tags/lib/additional_tags/patches/issue_patch.rb:49:in `available_tags'
[500c38a3-4286-46f6-b92e-8afdafb2add7] plugins/additional_tags/app/helpers/additional_tags_issues_helper.rb:49:in `sidebar_tags'
[500c38a3-4286-46f6-b92e-8afdafb2add7] plugins/additional_tags/app/views/issues/_tags_sidebar.html.slim:4
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook/view_listener.rb:61:in `block (2 levels) in render_on'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook/view_listener.rb:59:in `map'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook/view_listener.rb:59:in `block in render_on'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook.rb:66:in `block (2 levels) in call_hook'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook.rb:66:in `each'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook.rb:66:in `block in call_hook'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook.rb:63:in `call_hook'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/hook.rb:101:in `call_hook'
[500c38a3-4286-46f6-b92e-8afdafb2add7] app/views/issues/_sidebar.html.erb:2
[500c38a3-4286-46f6-b92e-8afdafb2add7] app/views/issues/show.html.erb:137
[500c38a3-4286-46f6-b92e-8afdafb2add7] app/views/issues/show.html.erb:136
[500c38a3-4286-46f6-b92e-8afdafb2add7] app/controllers/issues_controller.rb:118:in `block (2 levels) in show'
[500c38a3-4286-46f6-b92e-8afdafb2add7] app/controllers/issues_controller.rb:110:in `show'
[500c38a3-4286-46f6-b92e-8afdafb2add7] lib/redmine/sudo_mode.rb:61:in `sudo_mode'
alexandermeindl commented 1 year ago

Hi @pkoevesdi,

make sure you use latest version of additional_tags AND additionals, if you use the main branch. This should fix your problem. Or use stable branches of both plugins.

pkoevesdi commented 1 year ago

Both plugins are on branch stable, up-to-date (git pulled) and show version 3.0.9. Server is restarted.

pkoevesdi commented 1 year ago

Btw, already when clicking into the tags field of an issue, I see this in /var/log/redmine/default/production.log:

I, [2023-11-22T16:38:54.190728 #46834]  INFO -- : [76902714-a6e2-4659-ae90-4c86765d46f1] Started GET "/auto_completes/issue_tags?q=" for 10.172.11.80 at 2023-11-22 16:38:54 +0100
I, [2023-11-22T16:38:54.192707 #46834]  INFO -- : [76902714-a6e2-4659-ae90-4c86765d46f1] Processing by AutoCompletesController#issue_tags as JSON
I, [2023-11-22T16:38:54.192875 #46834]  INFO -- : [76902714-a6e2-4659-ae90-4c86765d46f1]   Parameters: {"q"=>""}
I, [2023-11-22T16:38:54.200087 #46834]  INFO -- : [76902714-a6e2-4659-ae90-4c86765d46f1]   Current user: p.koevesdi (id=5)
I, [2023-11-22T16:38:54.203201 #46834]  INFO -- : [76902714-a6e2-4659-ae90-4c86765d46f1] Completed 500 Internal Server Error in 10ms (ActiveRecord: 2.5ms | Allocations: 1633)
F, [2023-11-22T16:38:54.204461 #46834] FATAL -- : [76902714-a6e2-4659-ae90-4c86765d46f1]
[76902714-a6e2-4659-ae90-4c86765d46f1] Array::ArrayRowIsNotAHash (Array::ArrayRowIsNotAHash):
[76902714-a6e2-4659-ae90-4c86765d46f1]
[76902714-a6e2-4659-ae90-4c86765d46f1] plugins/additional_tags/lib/additional_tags/tags.rb:149:in `table_columns'
[76902714-a6e2-4659-ae90-4c86765d46f1] plugins/additional_tags/lib/additional_tags/tags.rb:35:in `available_tags'
[76902714-a6e2-4659-ae90-4c86765d46f1] plugins/additional_tags/lib/additional_tags/patches/issue_patch.rb:49:in `available_tags'
[76902714-a6e2-4659-ae90-4c86765d46f1] plugins/additional_tags/lib/additional_tags/patches/auto_completes_controller_patch.rb:15:in `issue_tags'
[76902714-a6e2-4659-ae90-4c86765d46f1] lib/redmine/sudo_mode.rb:61:in `sudo_mode'
pkoevesdi commented 1 year ago

Hey, nice, switched both additionals and additional_tags to branch main, now it works.