From 0819c38301f0480bcadc0051ff3a8d7277faa9cd Mon Sep 17 00:00:00 2001 From: oparizek Date: Wed, 4 Sep 2019 12:36:43 +0200 Subject: [PATCH 1/3] GSTV-649 Don't call translateCategory when the idCategory is empty --- classes/ProductJson.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ProductJson.php b/classes/ProductJson.php index e415ba3..fc35da4 100644 --- a/classes/ProductJson.php +++ b/classes/ProductJson.php @@ -111,7 +111,7 @@ private function getSingleProduct($id_product, $id_lang) private function getProductDefaultCategory($idCategory, $idLanguage) { - if (!isset($this->categoryCache[$idCategory])) { + if ($idCategory && !isset($this->categoryCache[$idCategory])) { $this->categoryCache[$idCategory] = $this->translateCategory($idCategory, $idLanguage); } return empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory]; From b09069ae1c3734444da0b54ad88335fb8c01e809 Mon Sep 17 00:00:00 2001 From: oparizek Date: Wed, 4 Sep 2019 12:49:04 +0200 Subject: [PATCH 2/3] GSTV-649 Bump plugin version to 1.2.1 --- roihunter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roihunter.php b/roihunter.php index 61af5f3..e0b5ba8 100644 --- a/roihunter.php +++ b/roihunter.php @@ -44,7 +44,7 @@ public function __construct() { $this->name = 'roihunter'; $this->tab = 'advertising_marketing'; - $this->version = '1.2.0'; + $this->version = '1.2.1'; $this->author = 'ROI Hunter'; $this->need_instance = 1; $this->bootstrap = true; From 01650c98fe1aaeea390b521ae403b2a0c965bbfb Mon Sep 17 00:00:00 2001 From: oparizek Date: Wed, 4 Sep 2019 13:25:39 +0200 Subject: [PATCH 3/3] GSTV-649 Safe condition in getProductDefaultCategory --- classes/ProductJson.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ProductJson.php b/classes/ProductJson.php index fc35da4..c52567e 100644 --- a/classes/ProductJson.php +++ b/classes/ProductJson.php @@ -114,7 +114,7 @@ private function getProductDefaultCategory($idCategory, $idLanguage) if ($idCategory && !isset($this->categoryCache[$idCategory])) { $this->categoryCache[$idCategory] = $this->translateCategory($idCategory, $idLanguage); } - return empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory]; + return !$idCategory || empty($this->categoryCache[$idCategory]) ? "" : $this->categoryCache[$idCategory]; } private function translateCategory($idCategory, $idLanguage)