From e77d4d3063bf17cc3d25d405dbe130a89848ca48 Mon Sep 17 00:00:00 2001 From: Paul Gear Date: Mon, 8 Jun 2015 21:50:50 +1000 Subject: [PATCH] Reverse the logic to make it clearer what is happening --- includes/polling/functions.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 5df7b181dd..c133161148 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -201,11 +201,11 @@ function poll_device($device, $options) foreach (dbFetch("SELECT `graph` FROM `device_graphs` WHERE `device_id` = ?", array($device['device_id'])) as $graph) { - if (!isset($graphs[$graph["graph"]])) + if (isset($graphs[$graph["graph"]])) { - dbDelete('device_graphs', "`device_id` = ? AND `graph` = ?", array($device['device_id'], $graph["graph"])); - } else { $oldgraphs[$graph["graph"]] = TRUE; + } else { + dbDelete('device_graphs', "`device_id` = ? AND `graph` = ?", array($device['device_id'], $graph["graph"])); } }