Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/nested entries in revisions #222

Merged
merged 3 commits into from
May 13, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes for CKEditor for Craft CMS

## Unreleased

- Fixed a bug where nested entries weren’t visible when viewing revisions. ([#227](https://github.com/craftcms/ckeditor/issues/227))
- Fixed a bug where nested entry cards were getting rendered after page load. ([#221](https://github.com/craftcms/ckeditor/discussions/221))

## 4.0.4 - 2024-04-25

- Fixed a bug where front-end links included element reference URL fragments. ([#197](https://github.com/craftcms/ckeditor/issues/197))
Expand Down
4 changes: 4 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,10 @@ protected function prepValueForInput($value, ?ElementInterface $element, bool $s
// Redactor to CKEditor syntax for <figure>
// (https://github.com/craftcms/ckeditor/issues/96)
$value = $this->_normalizeFigures($value);

// without this, nested entries won't show in revisions;
// not including it, also causes a layout shift when editing in the CP
$value = $this->_prepNestedEntriesForDisplay($value, $element?->siteId, $static);
}

return parent::prepValueForInput($value, $element);
Expand Down