Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#53704] BUG Visible=false project attribute values are deleted when a non-admin user edits the attributes (2/2) #15327

Merged
merged 4 commits into from May 8, 2024

Conversation

dombesz
Copy link
Contributor

@dombesz dombesz commented Apr 19, 2024

Part 2 of the https://community.openproject.org/wp/53704

Fixing the pending spec: https://github.com/opf/openproject/pull/15296/files#diff-fe00deb197cdde8955e039ce8b85ba36c57733622ad8753f4553379d57cc0e86R465-R471

Description

The callback Projects::ActsAsCustomizablePatches#disable_custom_fields_with_empty_values should be an after_save callback, because the custom_values association has autosave enabled by default and it has an after_create callback in the model (CustomValue#activate_custom_field_in_customized_project).

The after_create callback in the children objects are ran after the after_create callbacks on the parent. In order to make sure we execute this callback after the children's callbacks, the after_save hook must be used.

@dombesz dombesz force-pushed the bug/53704-part-2-fixing-enabling-hidden-fields branch from 1694ccb to 52c5294 Compare May 2, 2024 17:45
@dombesz dombesz changed the base branch from release/14.0 to dev May 2, 2024 17:46
@dombesz dombesz force-pushed the bug/53704-part-2-fixing-enabling-hidden-fields branch 6 times, most recently from 45c16b6 to 13c2311 Compare May 7, 2024 10:13
@dombesz dombesz marked this pull request as ready for review May 7, 2024 11:45
@dombesz dombesz force-pushed the bug/53704-part-2-fixing-enabling-hidden-fields branch 2 times, most recently from b00a930 to 4013519 Compare May 7, 2024 11:54
…to execute it after the related custom value records are saved.
@ulferts ulferts merged commit c4fb649 into dev May 8, 2024
9 checks passed
@ulferts ulferts deleted the bug/53704-part-2-fixing-enabling-hidden-fields branch May 8, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants