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

fix(dashboard): fix ProjectSystemDefaultChangeException #183

Open mingming-cn opened 3 months ago

mingming-cn commented 3 months ago

This PR is to fix a ProjectSystemDefaultChangeException that occurs when allowed_projects.count equals 1.

If you update the default project dashboard, the following exception will occur:

Dashboard::ProjectSystemDefaultChangeException (Dashboard::ProjectSystemDefaultChangeException):

plugins/additionals/app/models/dashboard.rb:389:in 'validate_project_system_default'
plugins/additionals/app/controllers/dashboards_controller.rb:113:in 'update'
lib/redmine/sudo_mode.rb:61:in 'sudo_mode'