From 3098b280d1a8f29f6b4fcbf77b04d4d850007fc7 Mon Sep 17 00:00:00 2001
From: Kevin Duret <duret.kevin@gmail.com>
Date: Mon, 19 Mar 2018 11:05:00 +0100
Subject: [PATCH] fix(upgrade): fix context in upgrade of 2.8.20 (#6145)

---
 www/install/php/Update-2.8.19_to_2.8.20.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/install/php/Update-2.8.19_to_2.8.20.php b/www/install/php/Update-2.8.19_to_2.8.20.php
index 63608025fc..aea5f32a49 100644
--- a/www/install/php/Update-2.8.19_to_2.8.20.php
+++ b/www/install/php/Update-2.8.19_to_2.8.20.php
@@ -36,9 +36,9 @@
 
 /* Set default poller with localhost if it is not set */
 if (isset($pearDB)) {
-    $res = $this->db->query("SELECT `name` FROM `nagios_server` WHERE `is_default` = 1");
+    $res = $pearDB->query("SELECT `name` FROM `nagios_server` WHERE `is_default` = 1");
 
     if( $res->rowCount() == 0) {
-        $res = $this->db->query("UPDATE `nagios_server` SET `is_default` = 1 WHERE `localhost` = '1'");
+        $res = $pearDB->query("UPDATE `nagios_server` SET `is_default` = 1 WHERE `localhost` = '1'");
     }
 }
-- 
GitLab