Skip to content

Commit 8781f56

Browse files
authored
Clone original model
Cloned old model to a new var instead of plain assignment Insolita@c941655#r61689650
1 parent c941655 commit 8781f56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/actions/UpdateAction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function run($id):Item
9292
if ($this->checkAccess) {
9393
call_user_func($this->checkAccess, $this->id, $model);
9494
}
95-
$originalModel = $model;
95+
$originalModel = clone $model;
9696
RelationshipManager::validateRelationships($model, $this->getResourceRelationships(), $this->allowedRelations);
9797
if (empty($this->getResourceAttributes()) && $this->hasResourceRelationships()) {
9898
$transact = $model::getDb()->beginTransaction();

0 commit comments

Comments
 (0)