From 23abf2663604a38c737cbfe11880a38f93a5eaa8 Mon Sep 17 00:00:00 2001 From: "r.fabiani" Date: Fri, 27 Sep 2024 15:38:54 +0200 Subject: [PATCH 1/3] Return early if no nested categories retrieved --- ps_categorytree.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ps_categorytree.php b/ps_categorytree.php index 6e9efa9..5e4c617 100644 --- a/ps_categorytree.php +++ b/ps_categorytree.php @@ -139,6 +139,9 @@ private function getCategories($category): array // Retrieve them using the built in method $categories = Category::getNestedCategories($category->id, $this->context->language->id, true, $groups, true, $sqlFilter, $orderBy); + if (empty($categories)) { + return []; + } // Get path to current category so we can use it for marking $idsOfCategoriesInPath = $this->getIdsOfCategoriesInPathToCurrentCategory(); From e1285e7998f24924ef4e41590e180b577e1b9faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hlav=C3=A1=C4=8Dek?= Date: Wed, 6 Nov 2024 10:49:58 +0100 Subject: [PATCH 2/3] Update ps_categorytree.php --- ps_categorytree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_categorytree.php b/ps_categorytree.php index 5e4c617..fe190b6 100644 --- a/ps_categorytree.php +++ b/ps_categorytree.php @@ -55,7 +55,7 @@ public function __construct() { $this->name = 'ps_categorytree'; $this->tab = 'front_office_features'; - $this->version = '3.0.0'; + $this->version = '3.0.1'; $this->author = 'PrestaShop'; $this->bootstrap = true; From 8343b4d16b472eab0af47ee6d013c58eb903e343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hlav=C3=A1=C4=8Dek?= Date: Wed, 6 Nov 2024 10:50:05 +0100 Subject: [PATCH 3/3] Update config.xml --- config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index 237b700..afb9aaf 100755 --- a/config.xml +++ b/config.xml @@ -2,10 +2,10 @@ ps_categorytree - + 1 1 - \ No newline at end of file +