From a42e68358e84f74370c08a6c661b6ee76ab55eef Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Mon, 4 Mar 2024 08:01:12 +0000 Subject: [PATCH 1/2] change signature of _prepNestedEntriesForDisplay --- src/Field.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Field.php b/src/Field.php index da9cc2e9..3a2d1aeb 100644 --- a/src/Field.php +++ b/src/Field.php @@ -880,7 +880,7 @@ protected function prepValueForInput($value, ?ElementInterface $element, bool $s // (https://github.com/craftcms/ckeditor/issues/96) $value = $this->_normalizeFigures($value); - $value = $this->_prepNestedEntriesForDisplay($value, $element->siteId, $static); + $value = $this->_prepNestedEntriesForDisplay($value, $element?->siteId, $static); } return parent::prepValueForInput($value, $element); @@ -1072,11 +1072,11 @@ private function _getEntryTypeOptions(): array * If it's a static request * * @param string $value - * @param int $elementSiteId + * @param int|null $elementSiteId * @param bool $static * @return string */ - private function _prepNestedEntriesForDisplay(string $value, int $elementSiteId, bool $static = false): string + private function _prepNestedEntriesForDisplay(string $value, ?int $elementSiteId, bool $static = false): string { [$entryIds, $markers] = $this->findEntries($value, true); From e62e84c8cb720a373e04389d7452b5d497d39ad5 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Wed, 6 Mar 2024 14:17:02 -0800 Subject: [PATCH 2/2] Release note --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 387d8605..8a4002ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - CKEditor config edit pages now warn when switching the Config Options setting from JavaScript to JSON if the JavaScript code contains any functions. ([#152](https://github.com/craftcms/ckeditor/issues/152), [#180](https://github.com/craftcms/ckeditor/pull/180)) - Fixed a bug where the “Link to an asset” option was showing up when there weren’t any available volumes with URLs. ([#179](https://github.com/craftcms/ckeditor/issues/179)) +- Fixed a bug where an error occurred when editing an unsaved element with a CKEditor field. ([#181](https://github.com/craftcms/ckeditor/issues/181)) ## 4.0.0-beta.7 - 2024-02-21