gpt4 book ai didi

magento2 - 无法访问 Magento 2.4.0 后端无法创建 acl 对象 : Invalid Document

转载 作者:行者123 更新时间:2023-12-05 00:45:31 29 4
gpt4 key购买 nike

我正在测试升级到 Magento 2.4,但出现以下错误。我读过此错误可能与自定义扩展中缺少的标题属性有关。为了尝试隔离问题,我从/app/code/文件夹中删除了所有扩展,然后运行 ​​upgrade ,再次编译过程,但即使删除了所有扩展,问题仍然存在。

知道如何调试吗?

1 exception(s):
Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 13


Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 13

<pre>#1 Magento\Framework\Acl\Builder\Proxy->getAcl() called at [vendor/magento/module-backend/Model/Auth/Session.php:229]
#2 Magento\Backend\Model\Auth\Session->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#3 Magento\Backend\Model\Auth->login() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#4 Magento\Backend\Model\Auth\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#5 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#6 Magento\Backend\Model\Auth\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:26]
#7 Magento\Backend\Model\Auth\Interceptor->login() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#8 Magento\Backend\App\Action\Plugin\Authentication->_performLogin() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#9 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#10 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#11 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#12 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:39]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#14 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:118]
#15 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#16 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#17 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#18 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#19 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#20 Magento\Framework\App\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#21 Magento\Framework\App\Bootstrap->run() called at [sitemaps/speedcrete/htdocs/index.php:44]

最佳答案

使用 ./vendor/magento/framework/Acl/etc/acl_merged.xsd 在开发模式下验证合并的 ACL。属性 title 是必需的:

<xs:attribute name="title" type="typeTitle" use="required" />

尝试在 ./vendor/magento/framework/Config/Reader/Filesystem.php:169 中设置断点并获取合并的 XML:

$configMerger->getDom()->saveXML();

然后使用在线验证器,如 https://www.freeformatter.com/xml-validator-xsd.html根据 XSD 验证您的 XML(使用 ./vendor/magento/framework/Acl/etc/acl.xsd 和必需的 title 属性)。

就我而言,我禁用了一些 magento 模块(Magento_InventoryApiMagento_InventoryInStorePickupApi):

<resource id="Magento_InventoryApi::inventory" title="Inventory" ... />
<resource id="Magento_InventoryInStorePickupApi::inStorePickup" title="In-Store Pickup" ... />

但我没有禁用依赖模块(Magento_InventoryInStorePickupSalesApi):

<resource id="Magento_InventoryApi::inventory">
<resource id="Magento_InventoryInStorePickupApi::inStorePickup">
<resource id="Magento_InventoryInStorePickupApi::notify_orders_are_ready_for_pickup" title="Notify Orders Are Ready For Pickup" ... />
</resource>
</resource>

所以,我合并的 ACL 是这样的:

<resource id="Magento_InventoryApi::inventory">
<resource id="Magento_InventoryInStorePickupApi::inStorePickup">
<resource id="Magento_InventoryInStorePickupApi::notify_orders_are_ready_for_pickup"
title="Notify Orders Are Ready For Pickup" translate="title" sortOrder="30"/>
</resource>
</resource>

对于 resource 节点没有必需的属性 title

关于magento2 - 无法访问 Magento 2.4.0 后端无法创建 acl 对象 : Invalid Document,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63301380/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com