From 58f4bf9c7ff44e52ebbe43bef8eb90a0c89a3123 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Fri, 18 Feb 2022 09:56:40 +0200 Subject: [PATCH 1/2] Fix queries on PostgreSQL --- plugins/system/helixultimate/helixultimate.php | 2 +- plugins/system/helixultimate/layout/settings/settings.php | 2 +- plugins/system/helixultimate/src/Platform/Helper.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/system/helixultimate/helixultimate.php b/plugins/system/helixultimate/helixultimate.php index 3f2ad3ac..d90a1d2a 100644 --- a/plugins/system/helixultimate/helixultimate.php +++ b/plugins/system/helixultimate/helixultimate.php @@ -670,7 +670,7 @@ private function getTemplateName($id = 0) if (empty($id)) { - $query->where($db->quoteName('home') . ' = 1'); + $query->where($db->quoteName('home') . ' = ' . $db->quote('1', false)); } else { diff --git a/plugins/system/helixultimate/layout/settings/settings.php b/plugins/system/helixultimate/layout/settings/settings.php index 3b582db9..ec523186 100644 --- a/plugins/system/helixultimate/layout/settings/settings.php +++ b/plugins/system/helixultimate/layout/settings/settings.php @@ -446,7 +446,7 @@ static public function getTemplateName() $query->select($db->quoteName(array('template'))); $query->from($db->quoteName('#__template_styles')); $query->where($db->quoteName('client_id') . ' = 0'); - $query->where($db->quoteName('home') . ' = 1'); + $query->where($db->quoteName('home') . ' = ' . $db->quote('1', false)); $db->setQuery($query); return $db->loadObject()->template; diff --git a/plugins/system/helixultimate/src/Platform/Helper.php b/plugins/system/helixultimate/src/Platform/Helper.php index 70614dc2..fc719f31 100644 --- a/plugins/system/helixultimate/src/Platform/Helper.php +++ b/plugins/system/helixultimate/src/Platform/Helper.php @@ -75,7 +75,7 @@ public static function getTemplateId($template) : int if (Multilanguage::isEnabled()) { - $query->where($db->quoteName('home') . ' IN(' . $db->quote(Factory::getLanguage()->getTag()) . ', 1)'); + $query->where($db->quoteName('home') . ' IN(' . $db->quote(Factory::getLanguage()->getTag()) . ', ' . $db->quote('1', false) . ')'); } $db->setQuery($query); From 23e58386e34811fde4216aa35031e3a8571ba843 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Fri, 18 Feb 2022 10:04:50 +0200 Subject: [PATCH 2/2] Make consistent with other queries --- plugins/system/helixultimate/src/Platform/Blog.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/system/helixultimate/src/Platform/Blog.php b/plugins/system/helixultimate/src/Platform/Blog.php index be0f22f8..bc037497 100644 --- a/plugins/system/helixultimate/src/Platform/Blog.php +++ b/plugins/system/helixultimate/src/Platform/Blog.php @@ -258,8 +258,8 @@ private static function getTemplate() $query->select($db->quoteName(array('template', 'params'))); $query->from($db->quoteName('#__template_styles')); - $query->where($db->quoteName('client_id') . ' = ' . $db->quote(0)); - $query->where($db->quoteName('home') . ' = ' . $db->quote(1)); + $query->where($db->quoteName('client_id') . ' = 0'); + $query->where($db->quoteName('home') . ' = ' . $db->quote('1', false)); $db->setQuery($query);