无法访问 Magento 2.4.0 后端无法创建 acl 对象:无效文档

use*_*769 3 magento2 magento-2.3

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

知道如何调试吗?

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]
Run Code Online (Sandbox Code Playgroud)

Ale*_*sev 5

合并的 ACL 在开发模式下使用 进行验证./vendor/magento/framework/Acl/etc/acl_merged.xsdtitle此处需要属性:

<xs:attribute name="title" type="typeTitle" use="required" />
Run Code Online (Sandbox Code Playgroud)

尝试设置断点./vendor/magento/framework/Config/Reader/Filesystem.php:169并将 XML 合并为:

$configMerger->getDom()->saveXML();
Run Code Online (Sandbox Code Playgroud)

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

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

<resource id="Magento_InventoryApi::inventory" title="Inventory" ... />
<resource id="Magento_InventoryInStorePickupApi::inStorePickup" title="In-Store Pickup" ... />
Run Code Online (Sandbox Code Playgroud)

但我没有禁用依赖模块(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>
Run Code Online (Sandbox Code Playgroud)

所以,我的合并 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>
Run Code Online (Sandbox Code Playgroud)

没有节点所需的title属性resource