如何修复“管理面板”中的“处理您的请求::指定的无效父ID(Magento_Backend :: mgs)时出错。.

时间:2019-04-05 13:04:08

标签: magento2

我正在使用Magento2,当我登录自己的网站时收到此消息。

  

处理您的请求时出错指定无效   父ID(Magento_Backend :: mgs)错误日志记录号:   1307308720759

此网站运行正常,但昨天我运行查询并重新编译,然后开始出现此问题。...

下面的错误日志详细信息

  

{“ 0”:“指定的无效父ID(Magento_Backend :: mgs)”,“ 1”:“#0   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(58):   Magento \ Backend \ Model \ Menu \ Builder-> getResult(Object(Magento \ Backend \ Model \ Menu))\ n#1   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(138):Magento \ Backend \ Model \ Menu \ Builder \ Interceptor-> ___ callParent('getResult',   阵列)\ n#2   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(153):Magento \ Backend \ Model \ Menu \ Builder \ Interceptor-> Magento \ Framework \ Interception \ {closure}(Object(Magento \ Backend \ Model \ Menu))\ n#3   /home/gervetus/public_html/Generated/code/Magento/Backend/Model/Menu/Builder/Interceptor.php(26):   Magento \ Backend \ Model \ Menu \ Builder \ Interceptor-> ___ callPlugins('getResult',   阵列,阵列)\ n#4   /home/gervetus/public_html/vendor/magento/module-backend/Model/Menu/Config.php(148):   Magento \后端\模型\菜单\构建器\拦截器-> getResult(对象(Magento \后端\模型\菜单))\ n#5   /home/gervetus/public_html/vendor/magento/module-backend/Model/Menu/Config.php(111):   Magento \ Backend \ Model \ Menu \ Config-> _ initMenu()\ n#6   /home/gervetus/public_html/vendor/magento/module-backend/Model/Url.php(361):   Magento \ Backend \ Model \ Menu \ Config-> getMenu()\ n#7   /home/gervetus/public_html/vendor/magento/module-backend/Model/Url.php(321):   Magento \ Backend \ Model \ Url-> _ getMenu()\ n#8   /home/gervetus/public_html/Generated/code/Magento/Backend/Model/Url/Interceptor.php(102):   Magento \ Backend \ Model \ Url-> getStartupPageUrl()\ n#9   /home/gervetus/public_html/vendor/magento/module-backend/App/AbstractAction.php(276):   Magento \ Backend \ Model \ Url \ Interceptor-> getStartupPageUrl()\ n#10   /home/gervetus/public_html/vendor/magento/module-backend/App/AbstractAction.php(208):   Magento \ Backend \ App \ AbstractAction-> _ processUrlKeys()\ n#11   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(58):   Magento \ Backend \ App \ AbstractAction-> dispatch(Object(Magento \ Framework \ App \ Request \ Http))\ n#12   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(138):Magento \ Backend \ Controller \ Adminhtml \ Index \ Index \ Interceptor-> ___ callParent('dispatch',   阵列)\ n#13   /home/gervetus/public_html/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143):   Magento \后端\ Controller \ Adminhtml \ Index \ Index \ Interceptor-> Magento \ Framework \ Intercept \ {closure}(对象(Magento \ Framework \ App \ Request \ Http))\ n#14   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(135):Magento \ Backend \ App \ Action \ Plugin \ Authentication-> aroundDispatch(Object(Magento \ Backend \ Controller \ Adminhtml \ Index \ Index \(拦截器),   对象(关闭),对象(Magento \ Framework \ App \ Request \ Http))\ n#15   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(153):Magento \ Backend \ Controller \ Adminhtml \ Index \ Index \ Interceptor-> Magento \ Framework \ Interception \ {closure}(Object(Magento \ Framework \ App \ Request \ Http))\ n#16   /home/gervetus/public_html/generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php(26):   Magento \ Backend \ Controller \ Adminhtml \ Index \ Index \ Interceptor-> ___ callPlugins('dispatch',   数组,NULL)\ n#17   /home/gervetus/public_html/vendor/magento/framework/App/FrontController.php(55):   Magento \ Backend \ Controller \ Adminhtml \ Index \ Index \ Interceptor-> dispatch(Object(Magento \ Framework \ App \ Request \ Http))\ n#18   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(58):   Magento \ Framework \ App \ FrontController-> dispatch(Object(Magento \ Framework \ App \ Request \ Http))\ n#19   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(138):Magento \ Framework \ App \ FrontController \ Interceptor-> ___ callParent('dispatch',   阵列)\ n#20   /home/gervetus/public_html/vendor/magento/framework/Interception/Interceptor.php(153):Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App \ Request \ Http))\ n#21   /home/gervetus/public_html/genic/code/Magento/Framework/App/FrontController/Interceptor.php(26):   Magento \ Framework \ App \ FrontController \ Interceptor-> ___ callPlugins('dispatch',   阵列,阵列)\ n#22   /home/gervetus/public_html/vendor/magento/framework/App/Http.php(135):   Magento \ Framework \ App \ FrontController \ Interceptor-> dispatch(对象(Magento \ Framework \ App \ Request \ Http))\ n#23   /home/gervetus/public_html/vendor/magento/framework/App/Bootstrap.php(256):   Magento \ Framework \ App \ Http-> launch()\ n#24   /home/gervetus/public_html/index.php(40):   Magento \ Framework \ App \ Bootstrap-> run(Object(Magento \ Framework \ App \ Http))\ n#25   {main}“,” url“:” / admin / admin / index / index / key / 6570ae1e6f609b1c1c0433e9e2307b5d7250e1e160091871b57a4326817cae2e /“,” script_name“:” / index.php“}

2 个答案:

答案 0 :(得分:1)

只需修改位于 /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"/>

这是它的外观

<?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>

答案 1 :(得分:0)

根据每个错误,mgs没有任何父代id名称,因此它将引发错误。

<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>

parent="Magento_Backend::content_elements"上方的代码中,将显示在内容菜单中,因此将有效的id赋予您的菜单,然后它将起作用。

作为参考,请参见此link