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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove set_query_available_custom_fields_to_project_level after validate hook from the AAC patch
Dombi Attilacadf65430863
diff --git a/app/models/projects/acts_as_customizable_patches.rb b/app/models/projects/acts_as_customizable_patches.rbindex 22c34dcdd0b..05fb4b360de 100644--- a/app/models/projects/acts_as_customizable_patches.rb+++ b/app/models/projects/acts_as_customizable_patches.rb@@ -39,11 +39,6 @@ module Projects::ActsAsCustomizablePatchesdependent: :destroy, inverse_of: :projecthas_many :project_custom_fields, through: :project_custom_field_project_mappings, class_name: "ProjectCustomField"- # we need to reset the query_available_custom_fields_on_global_level already after validation- # as the update service just calls .valid? and returns if invalid- # after_save is not touched in this case which causes the flag to stay active- after_validation :set_query_available_custom_fields_to_project_level-before_update :set_query_available_custom_fields_to_global_levelbefore_create :reject_section_scoped_validation_for_creationdiff --git a/app/services/projects/concerns/reset_global_query_after_validate_hook.rb b/app/services/projects/concerns/reset_global_query_after_validate_hook.rbindex 3c7855fda9d..3333e6b17b4 100644--- a/app/services/projects/concerns/reset_global_query_after_validate_hook.rb+++ b/app/services/projects/concerns/reset_global_query_after_validate_hook.rb@@ -31,6 +31,10 @@ module Projects::Concernsprivatedef after_validate(params, service_call)+ # we need to reset the query_available_custom_fields_on_global_level already after validation+ # as the update service just calls .valid? and returns if invalid+ # after_save is not touched in this case which causes the flag to stay active+ model = service_call.resultmodel._query_available_custom_fields_on_global_level = nilsuper