Allows localization variable to be saved as false. #7087
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.