Skip to content

Commit ef449e0

Browse files
Ghitutabacitu
authored andcommitted
Fix: Update removes many to many relations (#376)
Calling $this->update in restoreRevision method made a call to syncPivot method witch removed all related records.
1 parent 9671623 commit ef449e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PanelTraits/ViewsAndRestoresRevisions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function restoreRevision($id, $revisionId)
4747
$revision = Revision::findOrFail($revisionId);
4848

4949
// Update the revisioned field with the old value
50-
$this->update($entry->getKey(), [$revision->key => $revision->old_value]);
50+
$entry->update([$revision->key => $revision->old_value]);
5151

5252
// Reload the entry so we have the latest revisions
5353
$entry = $this->getEntry($id);

0 commit comments

Comments
 (0)