From 500ced2dc557f0cf09b774cad6d0a6adad44c88f Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 6 Aug 2021 19:14:43 -0400 Subject: [PATCH] When locking, use the results to reload the object fields fresh as they may have changed since the object was loaded --- web/includes/Object.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/includes/Object.php b/web/includes/Object.php index f7b93e3b5..96a572c01 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -434,6 +434,11 @@ class ZM_Object { $row = dbFetchOne("SELECT * FROM `$table` WHERE `Id`=?", NULL, array($this->Id())); if ( !$row ) { Error("Unable to lock $class record for Id=".$this->Id()); + } else { + // row may have been modified since initial load + foreach ($row as $k => $v) { + $this->{$k} = $v; + } } } public function remove_from_cache() {