event may have changed (have endtime set) between load and saving Archived bit. Lock the event which now also reloads it.
This commit is contained in:
parent
ae1e3d88b2
commit
b306f92116
|
@ -47,9 +47,12 @@ if ( $action == 'create' ) {
|
||||||
$monitor = new ZM\Monitor($monitor_id);
|
$monitor = new ZM\Monitor($monitor_id);
|
||||||
$monitor->TriggerOff();
|
$monitor->TriggerOff();
|
||||||
}
|
}
|
||||||
|
$dbConn->beginTransaction();
|
||||||
foreach ( $snapshot->Events() as $event ) {
|
foreach ( $snapshot->Events() as $event ) {
|
||||||
|
$event->lock();
|
||||||
$event->save(array('Archived'=>1));
|
$event->save(array('Archived'=>1));
|
||||||
}
|
}
|
||||||
|
$dbConn->commit();
|
||||||
$redirect = '?view=snapshot&id='.$snapshot->Id();
|
$redirect = '?view=snapshot&id='.$snapshot->Id();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue