From 07c2d59405a5bfaafc7c4a4394c64ea603cd8ce6 Mon Sep 17 00:00:00 2001 From: YAHIAOUI Hamza Date: Fri, 9 Sep 2022 11:11:57 +0100 Subject: [PATCH] applying suggested changes --- www/class/centreonMeta.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/class/centreonMeta.class.php b/www/class/centreonMeta.class.php index 6298d38968c..3290127b337 100644 --- a/www/class/centreonMeta.class.php +++ b/www/class/centreonMeta.class.php @@ -304,9 +304,9 @@ public function insertVirtualService($metaId, $metaName) if ($res->rowCount()) { $row = $res->fetchRow(); $serviceId = $row['service_id']; - $query = 'UPDATE service SET display_name = :display_name WHERE service_id = :service_id'; - $statement = $this->db->prepare($query); if ($row['display_name'] !== $metaName) { + $query = 'UPDATE service SET display_name = :display_name WHERE service_id = :service_id'; + $statement = $this->db->prepare($query); $statement->bindValue(':display_name', $metaName, \PDO::PARAM_STR); $statement->bindValue(':service_id', (int) $serviceId, \PDO::PARAM_INT); $statement->execute();