Skip to content

Commit

Permalink
Reset $owner->resaving
Browse files Browse the repository at this point in the history
Resolves #194
  • Loading branch information
brandonkelly committed Mar 15, 2024
1 parent 4210277 commit 1b80c41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed an error that could occur when editing an entry with nested CKEditor entries that used a soft-deleted entry type. ([#191](https://github.com/craftcms/ckeditor/issues/191))
- Fixed a bug where revisions weren’t getting created for the owner element, when CKEditor fields were edited. ([#194](https://github.com/craftcms/ckeditor/pull/194))

## 4.0.0 - 2024-03-14

Expand Down
3 changes: 3 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,12 @@ function(array $match) use ($oldEntryIds, $newEntryIds) {
if ($resave) {
// set resaving=true to avoid our EVENT_AFTER_PROPAGATE handler from dealing with the owner recursively,
// and to avoid a new revision getting created.
$resaving = $owner->resaving;
$owner->resaving = true;

Craft::$app->getElements()->saveElement($owner, false, $propagate, false);

$owner->resaving = $resaving;
}
}

Expand Down

0 comments on commit 1b80c41

Please sign in to comment.