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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes for CKEditor for Craft CMS

## Unreleased

- Fixed a bug where CKEditor field values weren’t always getting propagated to other sites (with duplicated nested entries) when creating a new element. ([#479](https://github.com/craftcms/ckeditor/pull/479))

## 4.11.0 - 2025-11-19

- Statically-rendered CKEditor fields are now shown in read-only mode. ([#466](https://github.com/craftcms/ckeditor/pull/466))
Expand Down
20 changes: 20 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ private static function adjustFieldValues(
}

if ($resave) {
if (version_compare(Craft::$app->getVersion(), '5.9.0', '>=')) {
/** @phpstan-ignore-next-line */
$owner->propagateRequired = false;
}
Craft::$app->getElements()->saveElement($owner, false, $propagate, false);
}
}
Expand Down Expand Up @@ -1904,4 +1908,20 @@ public function setEnableSourceEditingForNonAdmins(bool $value): void
{
$this->sourceEditingGroups = $value ? '*' : ['__ADMINS__'];
}

/**
* @inheritdoc
*/
public function propagateValue(ElementInterface $from, ElementInterface $to): void
{
/** @phpstan-ignore-next-line */
parent::propagateValue($from, $to);

if (!$from->propagateAll) {
// NestedElementManager won't duplicate the nested entries automatically,
// because the field has a value in the target site (the HTML content), so isValueEmpty() is false.
/** @phpstan-ignore-next-line */
self::entryManager($this)->duplicateNestedElements($from, $to, force: true);
}
}
}
Loading