Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed a bug where relations weren’t always propagating to newly-added sites for sections correctly. ([#16924](https://github.com/craftcms/cms/pull/16924))
- Fixed a bug where Assets fields set to restrict assets to a single location were relocating assets on element propagation. ([#12767](https://github.com/craftcms/cms/issues/12767), [#16936](https://github.com/craftcms/cms/issues/16936))
- Fixed a bug where relations weren’t getting saved for new elements, if the element was created with `Craft::createObject()` with its relation field data included in the passed-in config. ([#16942](https://github.com/craftcms/cms/pull/16942))

## 4.14.11.1 - 2025-03-19

Expand Down
6 changes: 4 additions & 2 deletions src/fields/BaseRelationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,10 @@ public function afterElementSave(ElementInterface $element, bool $isNew): void
{
// Skip if nothing changed, or the element is just propagating and we're not localizing relations
if (
($element->duplicateOf || $element->isFieldDirty($this->handle) || $this->maintainHierarchy) &&
(!$element->propagating || $this->localizeRelations)
$isNew || (
($element->duplicateOf || $element->isFieldDirty($this->handle) || $this->maintainHierarchy) &&
(!$element->propagating || $this->localizeRelations)
)
) {
/** @var ElementQueryInterface|Collection $value */
$value = $element->getFieldValue($this->handle);
Expand Down