Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing acl.xml title #2

Closed
pepijnblom opened this issue Aug 24, 2020 · 2 comments
Closed

Missing acl.xml title #2

pepijnblom opened this issue Aug 24, 2020 · 2 comments

Comments

@pepijnblom
Copy link

After upgrading a Magento 2 store to 2.4 locally I couldn't login to admin anymore and got the following error:

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


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

<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 [generated/code/Magento/Backend/Model/Auth/Session/Interceptor.php:102]
#3 Magento\Backend\Model\Auth\Session\Interceptor->processLogin() called at [vendor/magento/module-backend/Model/Auth.php:165]
#4 Magento\Backend\Model\Auth->login() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#5 Magento\Backend\Model\Auth\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#6 Magento\Backend\Model\Auth\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 Magento\Backend\Model\Auth\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Model/Auth/Interceptor.php:78]
#8 Magento\Backend\Model\Auth\Interceptor->login() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:205]
#9 Magento\Backend\App\Action\Plugin\Authentication->_performLogin() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:157]
#10 Magento\Backend\App\Action\Plugin\Authentication->_processNotLoggedInUser() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:125]
#11 Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#12 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins() called at [generated/code/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php:39]
#14 Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:186]
#15 Magento\Framework\App\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:119]
#16 Magento\Framework\App\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#17 Magento\Framework\App\FrontController\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#18 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#19 Magento\Framework\App\FrontController\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#20 Magento\Framework\App\FrontController\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#21 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#22 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#23 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]
</pre>

After having run the following command I managed to figure out it was this module causing the problem:

find . -type f -name acl.xml -exec awk 'FNR==7 {print FILENAME, $0}' {} \;|grep "<resource"|grep -v title|grep -v "Magento_"

./vendor/dotmailer/dotmailer-magento2-extension-chat/etc/acl.xml                     <resource id="Dotdigitalgroup_Email::automation">

I managed to fix the problem by adding a title to the tag. Now I'm not sure what you want to name it so I didn't make a PR, but I added a title like so and it fixed the issue:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::marketing">
                    <resource id="Dotdigitalgroup_Email::automation" title="dotdigital">
                        <resource id="Dotdigitalgroup_Chat::config" title="dotdigital Chat" sortOrder="15"/>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

@pepijnblom
Copy link
Author

I just realised this might be because we had Dotdigitalgroup_Email disabled.

Found this thread later:
magento/magento2#26573

@huykon
Copy link

huykon commented May 20, 2021

@pepijnblom I tried your solution but still not working

simon-letch pushed a commit that referenced this issue Oct 6, 2023
Related work items: #227794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants