From 59c926752f2549f0f31df22ebaf7473f2f8c9594 Mon Sep 17 00:00:00 2001 From: edalzell Date: Thu, 12 Dec 2024 16:16:49 -0800 Subject: [PATCH] save the non-revisable data --- src/Entries/Entry.php | 2 +- src/Http/Controllers/CP/Collections/EntriesController.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Entries/Entry.php b/src/Entries/Entry.php index 791fee7249..3b6de95e3f 100644 --- a/src/Entries/Entry.php +++ b/src/Entries/Entry.php @@ -701,7 +701,7 @@ public function makeFromRevision($revision) $entry ->published($attrs['published']) - ->data($attrs['data']) + ->data(array_merge($this->data()->all(), $attrs['data'])) ->slug($attrs['slug']); if ($this->collection()->dated() && ($date = Arr::get($attrs, 'date'))) { diff --git a/src/Http/Controllers/CP/Collections/EntriesController.php b/src/Http/Controllers/CP/Collections/EntriesController.php index 08921a71e1..37067e27c3 100644 --- a/src/Http/Controllers/CP/Collections/EntriesController.php +++ b/src/Http/Controllers/CP/Collections/EntriesController.php @@ -262,7 +262,8 @@ public function update(Request $request, $collection, $entry) ->save(); // catch any changes through RevisionSaving event - $entry = $entry->fromWorkingCopy(); + // have to save in case there are non-revisable fields + $entry = tap($entry->fromWorkingCopy())->save(); } else { if (! $entry->revisionsEnabled() && User::current()->can('publish', $entry)) { $entry->published($request->published);