From 8256544b95b9953b723165df5e263f273a4ee8d3 Mon Sep 17 00:00:00 2001 From: Thomas Templeton Date: Wed, 13 Nov 2024 13:32:24 +1100 Subject: [PATCH] Fix Neo content sometimes being lost on provisional draft after revert #899 --- CHANGELOG.md | 5 +++++ src/services/Fields.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e9b586..3f76ee8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Unreleased + +### Fixed +- Fixed a bug where reverting content on an entry with a provisional draft could cause Neo content on the provisional draft to be lost + ## 4.2.19 - 2024-10-31 ### Fixed diff --git a/src/services/Fields.php b/src/services/Fields.php index 7d2357bf..27fb9cb7 100644 --- a/src/services/Fields.php +++ b/src/services/Fields.php @@ -860,7 +860,7 @@ public function mergeCanonicalChanges(Field $field, ElementInterface $owner): vo $allBlocks[] = $derivativeBlock; } } - } elseif (!$canonicalBlock->trashed && $canonicalBlock->dateCreated > $owner->dateCreated) { + } elseif (!$canonicalBlock->trashed && $canonicalBlock->dateUpdated > $owner->dateCreated) { $allBlocks[] = $newBlock = $elementsService->duplicateElement($canonicalBlock, [ 'canonicalId' => $canonicalBlock->id, 'level' => $canonicalBlock->level,