From c8b9bcda1cdb78065dedba5ebf8d39518bee70d2 Mon Sep 17 00:00:00 2001 From: Ola Date: Tue, 5 Sep 2023 12:55:27 +0200 Subject: [PATCH 1/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a050b7c6..39b690c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Updated eslint version to `8.45.0` and `eslint-plugin-vue` to 9.15.1 (DEV-95002) ### Fixed - Mobile nav sidebar (DEV-101802) +- Category Child and CMS block nodes shouldn't have image fields (DEV-94387) ## [2.23.1] - 2023-07-28 ### Fixed - Fixed issue with closing } missing From 93e05430cc906a36f1edd87d70d113afd40fb478 Mon Sep 17 00:00:00 2001 From: Jose Ortega Date: Wed, 13 Sep 2023 10:15:45 +0200 Subject: [PATCH 2/2] #101741 Added exception when level of depth field is not a valid number --- Controller/Adminhtml/Menu/ImportCategories.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Controller/Adminhtml/Menu/ImportCategories.php b/Controller/Adminhtml/Menu/ImportCategories.php index e244eb30..aa9042c1 100644 --- a/Controller/Adminhtml/Menu/ImportCategories.php +++ b/Controller/Adminhtml/Menu/ImportCategories.php @@ -4,12 +4,12 @@ namespace Snowdog\Menu\Controller\Adminhtml\Menu; +use Exception; use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Framework\Controller\Result\JsonFactory; use Snowdog\Menu\Api\MenuManagementInterface; -use Magento\Framework\Exception\NoSuchEntityException; class ImportCategories extends Action implements HttpPostActionInterface { @@ -47,24 +47,27 @@ public function execute() { $categoryId = (int) $this->_request->getParam('category_id'); $depth = $this->_request->getParam('depth'); - if (!is_numeric($depth)) { - $depth = null; - } - $result = $this->resultJsonFactory->create(); try { + if (!is_numeric($depth)) { + throw new Exception('Please add a valid number for Level of depth field'); + } + $categoryTree = $this->menuManagement->getCategoryNodeList($categoryId, $depth); + $output = [ 'success' => 1, 'list' => $categoryTree ]; - } catch (NoSuchEntityException $exception) { + } catch (Exception $exception) { $output = [ 'success' => 0, 'message' => $exception->getMessage(), 'list' => [] ]; } + + $result = $this->resultJsonFactory->create(); $result->setData($output); return $result;