From 196f9a04fc41c0e8354f8e2959ad6ea49c27b0f8 Mon Sep 17 00:00:00 2001 From: Alex Dong Date: Thu, 10 Nov 2022 08:41:02 +0700 Subject: [PATCH] Fix error in PHP8.x --- Block/Widget/Categories.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Block/Widget/Categories.php b/Block/Widget/Categories.php index f065110..130dbd0 100644 --- a/Block/Widget/Categories.php +++ b/Block/Widget/Categories.php @@ -80,9 +80,9 @@ public function getCategories() $categories->addAttributeToSort('level'); }elseif($sortAttribute=='custom'){ $custom_sort= $this->getData('custom_sort'); - if(preg_match('/^(\d+,)+\d+$/',$custom_sort)){ + if(preg_match('/^(\d+,)+\d+$/', (string) $custom_sort)){ $custom_sort_arr = []; - $categoryIds = explode(',',$categoryIds); + $categoryIds = explode(',', (string) $categoryIds); $custom_sort_arr = explode(',',$custom_sort); $custom_sort_arr2 = array_merge(array_diff($custom_sort_arr, $categoryIds), array_diff($categoryIds,$custom_sort_arr)); $custom_sort_arr = array_merge($custom_sort_arr,$custom_sort_arr2);