Bugfix/17955 propagate required #18003
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.
Description
When publishing an unsaved draft that is no longer fresh, ensure all required attributes and custom fields that would otherwise be considered invalid are propagated across all relevant sites (as they do when a draft is considered fresh).
For example:
site1andsite2);alland entry type with required title and plain text fields, plus an optional number and email fields - all set to be translatable per site;site1, only fill out the number field;Before this change, your changes from step 5 would not be propagated to
site2, leading to a live entry without a title, with a temporary slug and with an empty required plain text field.With this change, all required fields that would otherwise be invalid are filled with the content from
site1.Added:
craft\base\ElementTrait::$propagateRequiredpropertycraft\base\Field::handlePropagateRequired()methodMade
craft\elements\NestedElementManager::duplicateNestedElements()method public.There’s also a supplementary PR for this in the CKEditor plugin repo: craftcms/ckeditor#479
Related issues
#17955