Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

increase robustness on non writable default module setting

ulferts78c137b98a23
diff --git a/db/migrate/20190507132517_add_board_view_to_roles.rb b/db/migrate/20190507132517_add_board_view_to_roles.rb
index e407292e2ad..42583fd0f18 100644
--- a/db/migrate/20190507132517_add_board_view_to_roles.rb
+++ b/db/migrate/20190507132517_add_board_view_to_roles.rb
@@ -34,7 +34,7 @@ class AddBoardViewToRoles < ActiveRecord::Migration[5.2]
.add(:view_work_packages,
:show_board_views)
- unless Setting.default_projects_modules.include?("board_view")
+ if Setting.default_projects_modules_writable? && Setting.default_projects_modules&.exclude?("board_view")
Setting.default_projects_modules = Setting.default_projects_modules + ["board_view"]
end
end
diff --git a/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
index 80ce0a01129..2e745e036b5 100644
--- a/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
+++ b/db/migrate/20240201115019_add_gantt_module_to_default_modules.rb
@@ -1,6 +1,6 @@
class AddGanttModuleToDefaultModules < ActiveRecord::Migration[7.0]
def up
- unless Setting.default_projects_modules.include?("gantt")
+ if Setting.default_projects_modules_writable? && Setting.default_projects_modules&.exclude?("gantt")
Setting.default_projects_modules = Setting.default_projects_modules + ["gantt"]
end
end