Не удается получить доступ к бэкэнду Magento 2.4.0 Не удалось создать объект acl: недопустимый документ - PullRequest
1 голос
/ 07 августа 2020

Я тестирую обновление до 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]

1 Ответ

0 голосов
/ 05 сентября 2020

Объединенный ACL проверяется в режиме разработки с помощью ./vendor/magento/framework/Acl/etc/acl_merged.xsd. Здесь требуется атрибут 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 для проверки вашего XML на XSD (используйте ./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" ... />

но я не отключил зависимый модуль (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>

без обязательного атрибута title для узла resource.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...