2

When I installed MGS "Mmegamenu" module in my magento v2.o.5. Frontend is loading fine but when I login to admin panel it is showing the below error :

Specified invalid parent id (Magento_Backend::mgs)

0 /var/www/html/magento2sd1/vendor/magento/module-backend/Model/Menu/Config.php(146): Magento\Backend\Model\Menu\Builder->getResult(Object(Magento\Backend\Model\Menu))...

Can you please help me in this. Thank you so much in advance.

3 Answers 3

5

There is no any parent id name with mgs so it will throw error

See below code is for page menu

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Magento_Cms::cms_page" title="Pages" module="Magento_Cms" sortOrder="0" parent="Magento_Backend::content_elements" action="cms/page" resource="Magento_Cms::page"/>
        <add id="Magento_Cms::cms_block" title="Blocks" module="Magento_Cms" sortOrder="30" parent="Magento_Backend::content_elements" action="cms/block" resource="Magento_Cms::block"/>
    </menu>
</config>

In above code parent="Magento_Backend::content_elements" so it will display in content menu so give valid id to your menu then it will work.

3
  • Thank you soo much prashant Valanda..It is working fine. Commented Jul 20, 2016 at 5:34
  • Please share path of this file also Commented Mar 4, 2020 at 6:11
  • @SayyedHasan you can add it in menu.xml file of your custom module inside app/code/Vendorname/Modulename/etc/adminhtml/menu.xml Commented Mar 15, 2020 at 7:32
1

I ran the command below via ssh in the Magento directly which solved the problem for me.

php bin/magento module:enable MGS_Core

Enabling the Core module of MGS seemed to be the issue. I must have disabled it before by mistake?

After that run:

php bin/magento setup:upgrade
0

Just modify the menu file located under /vendor/magento/module-cms/etc/adminthml/menu.xml

<add id="Magento_Backend::mgs" title="Blocks" translate="title" module="Magento_Cms" sortOrder="30" parent="Magento_Backend::mgs" action="cms/block" resource="Magento_Cms::block"/>

Here's how it'll look

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Magento_Cms::cms_page" title="Pages" translate="title" module="Magento_Cms" sortOrder="0" parent="Magento_Backend::content_elements" action="cms/page" resource="Magento_Cms::page"/>
        <add id="Magento_Cms::cms_block" title="Blocks" translate="title" module="Magento_Cms" sortOrder="30" parent="Magento_Backend::content_elements" action="cms/block" resource="Magento_Cms::block"/>
        <add id="Magento_Backend::mgs" title="Blocks" translate="title" module="Magento_Cms" sortOrder="30" parent="Magento_Backend::mgs" action="cms/block" resource="Magento_Cms::block"/>
    </menu>
</config>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.