From 672de6e84fac562a09619f1e1bb12575e76010fc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 6 Aug 2021 19:15:22 -0400 Subject: [PATCH] event may have changed (have endtime set) between load and saving Archived bit. Lock the event which now also reloads it. --- web/includes/actions/snapshot.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/includes/actions/snapshot.php b/web/includes/actions/snapshot.php index 1f5677453..a4add4f25 100644 --- a/web/includes/actions/snapshot.php +++ b/web/includes/actions/snapshot.php @@ -47,9 +47,12 @@ if ( $action == 'create' ) { $monitor = new ZM\Monitor($monitor_id); $monitor->TriggerOff(); } + $dbConn->beginTransaction(); foreach ( $snapshot->Events() as $event ) { + $event->lock(); $event->save(array('Archived'=>1)); } + $dbConn->commit(); $redirect = '?view=snapshot&id='.$snapshot->Id(); return; }