Skip to content

Commit

Permalink
save the non-revisable data
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Dec 13, 2024
1 parent cac88a7 commit 59c9267
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Entries/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Controllers/CP/Collections/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 59c9267

Please sign in to comment.