From 004fdbad9b7f3f15913ced0e97db6f23daa5ad7b Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 16 Jan 2018 09:31:23 -0500 Subject: [PATCH] We don't need to update ZoneCount manually anymore --- web/includes/actions.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/includes/actions.php b/web/includes/actions.php index 3d9369839..1c889f5de 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -379,7 +379,6 @@ if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) { dbQuery( 'UPDATE Zones SET '.implode( ', ', $changes ).' WHERE MonitorId=? AND Id=?', array( $mid, $zid) ); } else { dbQuery( 'INSERT INTO Zones SET MonitorId=?, '.implode( ', ', $changes ), array( $mid ) ); - dbQuery( 'UPDATE Monitors SET ZoneCount=(SELECT COUNT(Id) FROM Zones WHERE MonitorId=Monitors.Id) WHERE Id=?', array($mid)); } //if ( $cookies ) session_write_close(); if ( daemonCheck() ) { @@ -432,7 +431,6 @@ if ( !empty($_REQUEST['mid']) && canEdit( 'Monitors', $_REQUEST['mid'] ) ) { foreach( $_REQUEST['markZids'] as $markZid ) { $zone = dbFetchOne( 'select * from Zones where Id=?', NULL, array($markZid) ); dbQuery( 'delete from Zones WHERE MonitorId=? AND Id=?', array( $mid, $markZid) ); - dbQuery( 'UPDATE Monitors SET ZoneCount=(SELECT COUNT(Id) FROM Zones WHERE MonitorId=Monitors.Id) WHERE Id=?', array($mid)); $deletedZid = 1; } if ( $deletedZid ) {