alphanodes / additionals

Redmine plugin for easy customization of settings, text and content display by using personal or role-based dashboards (drag&drop), providing wiki macros and act as library for other plugins.
https://www.redmine.org/plugins/additionals
GNU General Public License v2.0
131 stars 43 forks source link

Undefined method locked for dashboards after update to newest versions #175

Closed mario-spitze closed 8 months ago

mario-spitze commented 8 months ago

We made some updates and i'm not sure when visit project dashboard the last time. Dashboard pages are not showed now. The project dashboards and the over all dashboard address replay an internal server error. Following is shown in production.log

I, [2023-12-29T07:51:59.890793 #1]  INFO -- : [16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8] Completed 500 Internal Server Error in 95ms (ActiveRecord: 22.7ms | Allocations: 41843)
F, [2023-12-29T07:51:59.891550 #1] FATAL -- : [16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8] ActionView::Template::Error (undefined method `locked?' for #<Dashboard id: 2, name: "Project dashboard", description: nil, dashboard_type: "ProjectDashboard", system_default: true, always_expose: false, enable_sidebar: true, project_id: nil, author_id: 1, visibility: 2, options: {:layout=>{"left"=>["projectinformation", "projectissues", "projecttimeentries"], "right"=>["projectmembers", "projectsubprojects"]}, :layout_settings=>{}}, created_at: "2021-10-07 13:21:36.252903000 +0000", updated_at: "2021-10-07 13:21:36.252903000 +0000">):
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]      5:   = call_hook :view_project_contextual_links, project: @project
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]      6: 
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]      7:   - if @dashboard&.editable?
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]      8:     - if @dashboard.locked?
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]      9:       = font_awesome_icon 'dashboard-locked fas_lock', title: l(:label_dashboard_lock_is_active)
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]     10:     - else
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]     11:       = form_tag _add_block_dashboard_path(@project, @dashboard), remote: true, id: 'block-form', authenticity_token: true do
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8]   
[16f7edec-dfeb-4d3b-8f3b-11a05e65cbd8] plugins/additionals/app/views/projects/show.html.slim:8

All other pages works without problems. The attribute is needed on some other points too. We use redmine with a docker environment and the following versions.

Environment:
  Redmine version                5.1.1.stable
  Ruby version                   3.2.2-p53 (2023-03-30) [x86_64-linux]
  Rails version                  6.1.7.6
  Environment                    production
  Database adapter               PostgreSQL
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Subversion                     1.14.2
  Mercurial                      6.3.2
  Bazaar                         3.3.2
  Git                            2.39.2
  Filesystem                     
Redmine plugins:
  additional_tags                3.1.0
  additionals                    3.1.0
  redmine_drawio                 1.4.7
  redmine_extended_watchers      5.1.0
  redmine_issue_templates        1.1.2
  redmine_wysiwyg_editor         0.32.0

i couldn't find further information's about a removed locked attribute and not firm with redmine internals. Please inform me if some more information's are needed or i have to test something.

alexandermeindl commented 8 months ago

Hi @mario-spitze,

did you run db migration, as described in https://github.com/alphanodes/additionals#update. It looks like a db migration is missing with your installation

mario-spitze commented 8 months ago

Ohw ... rtfm. We thought the migration is executed while we restart the container.

Manually execude the plugin migration solves the problem. Now we add the REDMINE_PLUGINS_MIGRATE to the docker-compose config. Thanks a lot!