From c460de75c6e1b10b3c2d3c251a373f1592ebf89d Mon Sep 17 00:00:00 2001 From: Riya Prajapati Date: Fri, 4 Jul 2025 10:55:16 +0530 Subject: [PATCH 01/13] Fixed isssue where assigning customer group to a category caused an error when trying to duplicate menu --- Service/Menu/Cloner.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Service/Menu/Cloner.php b/Service/Menu/Cloner.php index 269e54b2..e6d0f109 100644 --- a/Service/Menu/Cloner.php +++ b/Service/Menu/Cloner.php @@ -103,8 +103,12 @@ public function clone(MenuInterface $menu): MenuInterface foreach ($this->menuNodes->getList($menu) as $node) { $nodeClone = $this->nodeFactory->create(); + $data = $node->getData(); - $nodeClone->setData($node->getData()); + if (isset($data['customer_groups'])) { + $data['customer_groups'] = json_encode((array)$data['customer_groups']); + } + $nodeClone->setData($data); $nodeClone->setId(null); $nodeClone->setMenuId($menuCloneId); From f21ee3a879961189afec43ef7aecb405636ae05c Mon Sep 17 00:00:00 2001 From: Luuk Meijer Date: Fri, 10 Oct 2025 13:35:39 +0200 Subject: [PATCH 02/13] Changed processNodeObject function to public to allow Plugin hook classes --- Service/Menu/SaveRequestProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Service/Menu/SaveRequestProcessor.php b/Service/Menu/SaveRequestProcessor.php index af6d542e..dc6e39a5 100644 --- a/Service/Menu/SaveRequestProcessor.php +++ b/Service/Menu/SaveRequestProcessor.php @@ -159,7 +159,7 @@ public function saveData(MenuInterface $menu, array $nodes = []): void * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ - private function processNodeObject( + public function processNodeObject( NodeInterface $nodeObject, array $nodeData, MenuInterface $menu, From adf0f9ece896a327c25534ec7563bf4c5cfb8054 Mon Sep 17 00:00:00 2001 From: Kashyap Date: Tue, 7 Oct 2025 11:17:59 +0530 Subject: [PATCH 03/13] Solved relative custom URL breaks when Magento store code is included in URLs --- Block/NodeType/CustomUrl.php | 25 +++++++++++++++++++ .../menu/node_type/custom_url.phtml | 8 +++--- .../menu/node_type/custom_url.phtml | 8 +++--- .../menu/node_type/custom_url.phtml | 6 ++--- .../templates/menu/node_type/custom_url.phtml | 7 +++--- 5 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Block/NodeType/CustomUrl.php b/Block/NodeType/CustomUrl.php index 37e94db7..5032c430 100644 --- a/Block/NodeType/CustomUrl.php +++ b/Block/NodeType/CustomUrl.php @@ -112,4 +112,29 @@ public function getLabel() { return __("Custom Url"); } + + /** + * @param int $nodeId + * + * @return string + */ + public function getCustomUrl($nodeId) + { + $node = $this->nodes[$nodeId]; + $nodeContent = $node->getContent(); + $url = ''; + + if ( + $nodeContent + && $nodeContent !== '#' + && stripos($nodeContent, 'javascript:void') === false + && !$this->isExternalUrl($nodeContent) + ) { + $url = $this->_storeManager->getStore()->getBaseUrl() . ltrim($nodeContent, '/'); + } else { + $url = $nodeContent; + } + + return $url; + } } diff --git a/view/frontend/templates/hyva-menu-footer/menu/node_type/custom_url.phtml b/view/frontend/templates/hyva-menu-footer/menu/node_type/custom_url.phtml index ca44f36a..fc886315 100644 --- a/view/frontend/templates/hyva-menu-footer/menu/node_type/custom_url.phtml +++ b/view/frontend/templates/hyva-menu-footer/menu/node_type/custom_url.phtml @@ -12,15 +12,15 @@ $imageUrl = $block->getImageUrl(); $imageAltText = $block->getImageAltText(); $imageWidth = $block->getImageWidth(); $imageHeight = $block->getImageHeight(); -$content = $block->getContent(); +$url = $block->getCustomUrl($nodeId); $title = $block->getTitle(); $dataAttribute = 'data-menu="menu-' . $nodeId . '"'; $nodeClasses = $block->getNodeClasses(); ?> - + - getTarget()): ?> @@ -36,7 +36,7 @@ $nodeClasses = $block->getNodeClasses(); /> - data-menu="menu-escapeHtmlAttr($nodeId) ?>" diff --git a/view/frontend/templates/hyva-topmenu-desktop/menu/node_type/custom_url.phtml b/view/frontend/templates/hyva-topmenu-desktop/menu/node_type/custom_url.phtml index 97143d24..93d21619 100644 --- a/view/frontend/templates/hyva-topmenu-desktop/menu/node_type/custom_url.phtml +++ b/view/frontend/templates/hyva-topmenu-desktop/menu/node_type/custom_url.phtml @@ -12,15 +12,15 @@ $imageUrl = $block->getImageUrl(); $imageAltText = $block->getImageAltText(); $imageWidth = $block->getImageWidth(); $imageHeight = $block->getImageHeight(); -$content = $block->getContent(); +$url = $block->getCustomUrl($nodeId); $title = $block->getTitle(); $dataAttribute = 'data-menu="menu-' . $nodeId . '"'; $nodeClasses = $block->getNodeClasses(); ?> - + - getTarget()): ?> @@ -36,7 +36,7 @@ $nodeClasses = $block->getNodeClasses(); /> - data-menu="menu-escapeHtmlAttr($nodeId) ?>" diff --git a/view/frontend/templates/hyva-topmenu-mobile/menu/node_type/custom_url.phtml b/view/frontend/templates/hyva-topmenu-mobile/menu/node_type/custom_url.phtml index f185e714..5fd8c452 100644 --- a/view/frontend/templates/hyva-topmenu-mobile/menu/node_type/custom_url.phtml +++ b/view/frontend/templates/hyva-topmenu-mobile/menu/node_type/custom_url.phtml @@ -8,15 +8,15 @@ use Snowdog\Menu\Block\NodeType\CustomUrl; ?> getId(); -$content = $block->getContent(); +$url = $block->getCustomUrl($nodeId); $title = $block->getTitle(); $dataAttribute = 'data-menu="menu-' . $nodeId . '"'; $nodeClasses = $block->getNodeClasses(); ?> - + getTarget()): ?> target="_blank" rel="noopener" diff --git a/view/frontend/templates/menu/node_type/custom_url.phtml b/view/frontend/templates/menu/node_type/custom_url.phtml index 22756b64..d04152ea 100644 --- a/view/frontend/templates/menu/node_type/custom_url.phtml +++ b/view/frontend/templates/menu/node_type/custom_url.phtml @@ -13,7 +13,8 @@ $imageUrl = $block->getImageUrl(); $imageAltText = $block->getImageAltText(); $imageWidth = $block->getImageWidth(); $imageHeight = $block->getImageHeight(); -$content = $block->getContent(); +$nodeId = $block->getId(); +$url = $block->getCustomUrl($nodeId); if ($block->getIsViewAllLink()) { $title = __('View All'); @@ -32,9 +33,9 @@ if ($block->getTarget()) { } $allAttributes = implode(' ', $attributes); ?> - + > escapeHtml($title); ?> From 2460cd0b0de0c49b5a946c6c267f046ae255e600 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:30:16 +0000 Subject: [PATCH 04/13] Bump lodash from 4.17.21 to 4.17.23 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.21 to 4.17.23. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.21...4.17.23) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.17.23 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index aed8db21..6c83d739 100644 --- a/yarn.lock +++ b/yarn.lock @@ -511,9 +511,9 @@ lodash.merge@^4.6.2: integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + version "4.17.23" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.23.tgz#f113b0378386103be4f6893388c73d0bde7f2c5a" + integrity sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w== lru-cache@^6.0.0: version "6.0.0" From e38f0832352baf38daf22c2573a34f235bc3e8ae Mon Sep 17 00:00:00 2001 From: Martyna Maciejewska Date: Thu, 29 Jan 2026 14:50:23 +0100 Subject: [PATCH 05/13] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43409c6..566febf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Updated +- Bump lodash from 4.17.21 to 4.17.23 ([#390](https://github.com/SnowdogApps/magento2-menu/pull/390)) ### Removed - Frontend console log (SMM-46) - Unused variables from phtml files ([#357](https://github.com/SnowdogApps/magento2-menu/pull/357)) From 73d26e6f791110e71f25108b130451966a104d8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Feb 2026 04:09:56 +0000 Subject: [PATCH 06/13] Bump minimatch from 3.1.2 to 3.1.5 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6c83d739..3ee81d73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -523,9 +523,9 @@ lru-cache@^6.0.0: yallist "^4.0.0" minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + version "3.1.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== dependencies: brace-expansion "^1.1.7" From 2f23eda2eda617bf85fe1a8dd612c041824a8e6c Mon Sep 17 00:00:00 2001 From: Martyna Maciejewska Date: Mon, 23 Mar 2026 17:08:09 +0100 Subject: [PATCH 07/13] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 566febf8..cbf30718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Updated +- Bump minimatch from 3.1.2 to 3.1.5 ([#395](https://github.com/SnowdogApps/magento2-menu/pull/395)) - Bump lodash from 4.17.21 to 4.17.23 ([#390](https://github.com/SnowdogApps/magento2-menu/pull/390)) ### Removed - Frontend console log (SMM-46) From 4f589fc28ee0393d9f334aacb6fa84100838428e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 03:26:57 +0000 Subject: [PATCH 08/13] Bump lodash from 4.17.23 to 4.18.1 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1) --- updated-dependencies: - dependency-name: lodash dependency-version: 4.18.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 3ee81d73..6c246a96 100644 --- a/yarn.lock +++ b/yarn.lock @@ -511,9 +511,9 @@ lodash.merge@^4.6.2: integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== lodash@^4.17.21: - version "4.17.23" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.23.tgz#f113b0378386103be4f6893388c73d0bde7f2c5a" - integrity sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w== + version "4.18.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.18.1.tgz#ff2b66c1f6326d59513de2407bf881439812771c" + integrity sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q== lru-cache@^6.0.0: version "6.0.0" From a52a067f141ad07f79e2f72cbb2143fcfab3ac89 Mon Sep 17 00:00:00 2001 From: Martyna Maciejewska Date: Mon, 13 Apr 2026 09:26:19 +0200 Subject: [PATCH 09/13] SMM-92 Update lodash --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 6c246a96..22505cec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -510,7 +510,7 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash@^4.17.21: +lodash@^4.18.1: version "4.18.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.18.1.tgz#ff2b66c1f6326d59513de2407bf881439812771c" integrity sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q== From 44a5be74e8372be2590189255d9ef3b4697cd362 Mon Sep 17 00:00:00 2001 From: Martyna Maciejewska Date: Tue, 14 Apr 2026 09:25:53 +0200 Subject: [PATCH 10/13] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf30718..fbe96f64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Updated - Bump minimatch from 3.1.2 to 3.1.5 ([#395](https://github.com/SnowdogApps/magento2-menu/pull/395)) - Bump lodash from 4.17.21 to 4.17.23 ([#390](https://github.com/SnowdogApps/magento2-menu/pull/390)) +- Bump lodash from 4.17.23 to 4.18.1 ([#404](https://github.com/SnowdogApps/magento2-menu/pull/404)) ### Removed - Frontend console log (SMM-46) - Unused variables from phtml files ([#357](https://github.com/SnowdogApps/magento2-menu/pull/357)) From fd3994997b0801648b1bb9239006fb7118efb7ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 15 Nov 2025 10:39:11 +0000 Subject: [PATCH 11/13] Bump js-yaml from 4.1.0 to 4.1.1 Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.0 to 4.1.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 22505cec..1f453469 100644 --- a/yarn.lock +++ b/yarn.lock @@ -474,9 +474,9 @@ isexe@^2.0.0: integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" From 94a7a3b36b45a4d4245d94cb1c998a210e4ac66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Pereira?= Date: Tue, 14 Apr 2026 12:49:23 -0300 Subject: [PATCH 12/13] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe96f64..7dbb0334 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. - Bump minimatch from 3.1.2 to 3.1.5 ([#395](https://github.com/SnowdogApps/magento2-menu/pull/395)) - Bump lodash from 4.17.21 to 4.17.23 ([#390](https://github.com/SnowdogApps/magento2-menu/pull/390)) - Bump lodash from 4.17.23 to 4.18.1 ([#404](https://github.com/SnowdogApps/magento2-menu/pull/404)) +- Bump js-yaml from 4.1.0 to 4.1.1 ([#387](https://github.com/SnowdogApps/magento2-menu/pull/387)) ### Removed - Frontend console log (SMM-46) - Unused variables from phtml files ([#357](https://github.com/SnowdogApps/magento2-menu/pull/357)) From 4baa16666d2e43f2bada146cf3d6f091b6b16f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Pereira?= Date: Fri, 24 Apr 2026 14:59:58 -0300 Subject: [PATCH 13/13] SMM-54 Calling SerializerInterface instead of json_encode --- Service/Menu/Cloner.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Service/Menu/Cloner.php b/Service/Menu/Cloner.php index e6d0f109..1beea3d3 100644 --- a/Service/Menu/Cloner.php +++ b/Service/Menu/Cloner.php @@ -6,6 +6,7 @@ use Exception; use Magento\Framework\App\ResourceConnection; +use Magento\Framework\Serialize\SerializerInterface; use Snowdog\Menu\Api\Data\MenuInterface; use Snowdog\Menu\Api\Data\MenuInterfaceFactory; use Snowdog\Menu\Api\Data\NodeInterfaceFactory; @@ -57,6 +58,11 @@ class Cloner */ private $menuNodes; + /** + * @var SerializerInterface + */ + private $serializer; + public function __construct( ResourceConnection $resource, MenuInterfaceFactory $menuFactory, @@ -65,7 +71,8 @@ public function __construct( NodeRepositoryInterface $nodeRepository, MenuIdentifierProcessor $menuIdentifierProcessor, NodeTypeProvider $nodeTypeProvider, - MenuNodes $menuNodes + MenuNodes $menuNodes, + SerializerInterface $serializer ) { $this->resource = $resource; $this->menuFactory = $menuFactory; @@ -75,6 +82,7 @@ public function __construct( $this->menuIdentifierProcessor = $menuIdentifierProcessor; $this->nodeTypeProvider = $nodeTypeProvider; $this->menuNodes = $menuNodes; + $this->serializer = $serializer; } /** @@ -106,8 +114,9 @@ public function clone(MenuInterface $menu): MenuInterface $data = $node->getData(); if (isset($data['customer_groups'])) { - $data['customer_groups'] = json_encode((array)$data['customer_groups']); + $data['customer_groups'] = $this->serializer->serialize((array) $data['customer_groups']); } + $nodeClone->setData($data); $nodeClone->setId(null); $nodeClone->setMenuId($menuCloneId);