magento2-menu
magento2-menu copied to clipboard
Issue with 'Import from Categories'
Hi,
I've recently installed your module as part of a Hyva build into 2 Magento installs. The first worked as expected. The second I have an issue in the Magento backend that I can not use the 'Import from Categories' option to populate the menu.
When I click 'Import from Categories' I get the flyout but the Root Category dropdown is empty. This install is a Magento multi domain/website setup. It happens for all menus I create and it doesn't change if I select All store views or a specific store from the store view selector.
In the browser console, I do get this error message though.
[2024-03-09 01:15:32] [ERROR] Failed to load the "ui/form/element/select" template requested by "snowmenu_menu_form.snowmenu_menu_form.import_categories_tree_modal.general.category_id".
Hi @chrisastley
I cannot reproduce this issue on M2.4.6-p4 and snowdog/module-menu
version 2.25.0.
This issue may come from some modification to vendor/magento/module-ui/view/base/web/templates/form/element/select.html
. If that is the case then in Browser Console before the error message you have provided should be displayed a more verbose warning message. You can check the requested filepath by checking Network tab in Browser Console (the request is made when clicking the Import from categories button, before the popup is opened).
For example, when I edit that file and change inputName
to inputNaame
then I get the same as You error with warning message with what is the cause
Message: inputNaame is not defined attr
.
Hi,
Apologies for the delay in getting back to you. I've had some time on this over the last couple of days but haven't been able to resolve the issue yet.
I've done some testing on working site I have this installed on. It is only a single website install. I created a second category root with a test category and child. Added a new website/store/storeview using the second root category.
When I go to the import I notice it only lists the original root category assigned to the default store. But it does list my top level category in the list of sub categories under the original root.
When I investigated the code in this file vendor/snowdog/module-menu/Ui/Component/Menu/Form/Element/Categories.php I found you have this const DEFAULT_CATEGORY_ID = 2;
Doesn't look like your module is setup for the import to work properly with multiple root categories so I have modified the file and this is the pull request #318
Good morning @adamwaclawczyk
I have resolved the issue, it was an issue with data. I use a module to create products and categories and it had added an incomplete category with no title.
The commit I added yesterday would be great if you can get this in the next release.
Regards
Same issue here. If root cat ID is not 3 in database then import all caterogry structure not working. @chrisastley commit works fine. You should add it. Thanks!
Closing since the issue was resolved. FYI @chrisastley #318 was merged to develop and will be added to next release.