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

Allows localization variable to be saved as false. #7087

Merged
merged 3 commits into from Nov 30, 2022
Merged

Allows localization variable to be saved as false. #7087

merged 3 commits into from Nov 30, 2022

Conversation

tao
Copy link
Contributor

@tao tao commented Nov 19, 2022

The localisation variable is always reset as true when updating blueprints. If you have a field that is not localizable and update the blueprint for any reason, the field is sent in the PATCH request with localizable: false which is then unset by this code. This means if the field has been localizable before then it can't be changed to non-localizable... this causes an issue as slugs are default localizable even when multisite is not enabled.

This code checks if multisite is enabled, and prevents the field from being unset. This fixes #7082, fixes #4471 and continues to allow the localizable field to be unset on single sites so their blueprints remain unchanged. On multi-sites, each blueprint will be updated the next time they are saved, and will explicitly say if fields are localizable or not by adding localizable: false to each one, and allow fields to be saved on non-localizable from the control panel.

The localisation variable is always reset as true when updating blueprints. If you have a field that is not localizable and update the blueprint for any reason, the field is sent in the PATCH request with `localizable: false` which is then unset by this code. This means if the field has been localizable before then it can't be changed to non-localizable... which causes an issue as slugs are default localizable even when multisite is not enabled.

This code checks if multisite is enabled, and prevents the field from being unset. This fixes #7082, #4471 and continues to allow the localizable field to be unset on single sites so that the blueprints remain unaffected. On multi-sites, the blueprints will be updated the next time they are saved, and will explicitly say if fields are localizable or not by adding `localizable: false` to each one.
@what-the-diff
Copy link

what-the-diff bot commented Nov 19, 2022

  • The localizable field is now only removed if the site has multiple sites.

@jasonvarga jasonvarga merged commit a960208 into statamic:3.3 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants