2

I have just updated my magento version from 2.4.0 to 2.4.6 and i am getting this error on frontend.Please suggest any solution. Also i have custom theme but i am not getting why this error is occuring. Any leads would be highly appreciated.

<div id="authenticationPopup" data-bind="scope:'authenticationPopup', style: {display: 'none'}">
        <script>window.authenticationPopup = {"autocomplete":"off","customerRegisterUrl":"https:\/\/dev\/customer\/account\/create\/","customerForgotPasswordUrl":"https:\/\/dev\/customer\/account\/forgotpassword\/","baseUrl":"https:\/\/dev\/","customerLoginUrl":"https:\/\/dev\/customer\/ajax\/login\/"}</script>    <!-- ko template: getTemplate() --><!-- /ko -->
        <script type="text/x-magento-init">
        {
            "#authenticationPopup": {
                "Magento_Ui/js/core/app": {"components":{"authenticationPopup":{"component":"Magento_Customer\/js\/view\/authentication-popup","children":{"messages":{"component":"Magento_Ui\/js\/view\/messages","displayArea":"messages"}}}}}            },
            "*": {
                "Magento_Ui/js/block-loader": "https\u003\u002F\u002Fdev\u003A16443\u002Fpub\u002Fstatic\u002Ffrontend\u02\u00\u00S\u00\u0loader\u002D1.gif"
                Error: Call to a member function isGlobalScopeEnabled() on null in /home/websites/hollywoo/dev/public_html/vendor/magento/module-customer/view/frontend/templates/account/authentication-popup.phtml:26

1 Answer 1

3

Maybe an issue with your theme level: app/design/frontend/YourThemeVendor/YourTheme/Magento_Customer/layout/default.xml

Compare this file with vendor/magento/module-customer/view/frontend/layout/default.xml

You need to pass view_model like:

<block class="Magento\Customer\Block\Account\AuthenticationPopup" name="authentication-popup" as="authentication-popup" template="Magento_Customer::account/authentication-popup.phtml">
    <arguments>
        <argument name="jsLayout" xsi:type="array">
            <item name="components" xsi:type="array">
                <item name="authenticationPopup" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Customer/js/view/authentication-popup</item>
                    <item name="children" xsi:type="array">
                        <item name="messages" xsi:type="array">
                            <item name="component" xsi:type="string">Magento_Ui/js/view/messages</item>
                            <item name="displayArea" xsi:type="string">messages</item>
                        </item>
                    </item>
                </item>
            </item>
        </argument>
        <argument name="view_model" xsi:type="object">Magento\Customer\ViewModel\Customer\StoreConfig</argument>
    </arguments>
</block>
1
  • Yes. It saved my day! Commented Oct 31, 2023 at 13:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.