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

Posted

技术标签:

【中文标题】如何在管理面板中修复“处理您的请求时出错 :: 指定无效父 ID (Magento_Backend::mgs)”..?【英文标题】:How to Fix "There has been an error processing your request :: Specified invalid parent id (Magento_Backend::mgs)" in Admin Panel..? 【发布时间】:2019-08-27 09:32:50 【问题描述】:

我正在使用 Magento2,当我登录我的网站时,我收到了这条消息。

处理您的请求时出错 指定无效 parent 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 \型号\菜单))\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\Backend\Model\Menu\Builder\Interceptor->getResult(Object(Magento\Backend\Model\Menu))\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\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\closure(Object(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', 数组,空)\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 \请求\Http))\n#21 /home/gervetus/public_html/generated/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(Object(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"

【问题讨论】:

【参考方案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>

【讨论】:

【参考方案2】:

根据错误,没有任何带有 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

【讨论】:

能否请您指导我这个文件在哪里以及我编辑的内容...? 您需要访问服务器,因为您可能需要启用/禁用任何模块。通过这个你也需要运行升级脚本。由于您的管理员无法正常工作,因此如果您认为此问题与缓存相关,则必须需要服务器来删除缓存。 我已经重置了缓存,但仍然面临同样的问题,我有 SSH 访问权限和 FTP 访问权限,只是指导我如何解决这个问题..?

以上是关于如何在管理面板中修复“处理您的请求时出错 :: 指定无效父 ID (Magento_Backend::mgs)”..?的主要内容,如果未能解决你的问题,请参考以下文章

怎么修复MSDTC服务

如何修复VS2017?

w7电脑usb驱动怎么修复

如何修复 flexdashboard 中的下载按钮侧边栏问题

当我将网站上传到生产环境时,如何修复错误 500

有哪些免费好用的Linux服务器管理面板?