0

I have a custom Luma theme I use for my store, for whatever reason sign in link is missing but I do have Create an Account on the header - where should I start looking to resolve this issue. I see system error report, "main.CRITICAL: Broken reference: No element found with ID 'customer'

I am guessing its related to missing login

Thanks

here my custom theme XML

<?xml version="1.0"?>

<referenceBlock name="footer_links" remove="true" />
    <referenceContainer name="header.panel">
        <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
            <arguments>
                <argument name="css_class" xsi:type="string">header links</argument>
            </arguments>
        </block>
    </referenceContainer>
    <referenceBlock name="logo">
        <arguments>
            <argument name="logo_img_width" xsi:type="number">148</argument>
            <argument name="logo_img_height" xsi:type="number">43</argument>
        </arguments>
    </referenceBlock>
    <referenceContainer name="footer">
        <block class="Magento\Store\Block\Switcher" name="store_switcher" as="store_switcher" after="footer_links" template="switch/stores.phtml"/>
    </referenceContainer>
    <referenceBlock name="report.bugs" remove="true"/>
    <move element="copyright" destination="before.body.end"/>
</body>

  • So if you have a custom theme.... how could anyone know about it ? we are not mind readers – Gosu Przmak Jan 20 at 20:06
  • like I mention I HAVE A CUSTOM LUMA THEME. if you are not going to help maybe you should not answer this... – roger Jan 20 at 22:31
  • i will give you a hint, look in the .xml files but what files it could be... like it can be anywhere default.xml files prolly it can also be in a template .phtml or a javascript could be rewritten ... there are just many possibilites :P – Gosu Przmak Jan 20 at 22:39
0

The first thing I would do is view source on the page and make sure that the link is actually missing, vs. hidden with CSS, obscured behind some other element etc. Seems unlikely in this case, but it is the fastest thing to check.

By default in Luma, the "Sign In" link is defined in vendor/magento/theme-frontend-luma/Magento_Customer/layout/default.xml in the authorization-link-login block:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="header.links">
            <block class="Magento\Customer\Block\Account\Customer" name="customer" template="Magento_Customer::account/customer.phtml" before="-"/>
            <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login" template="Magento_Customer::account/link/authorization.phtml">
                <arguments>
                    <argument name="sortOrder" xsi:type="number">10</argument>
                </arguments>
            </block>
        </referenceBlock>
        <move element="header" destination="header.links" before="-"/>
        <move element="register-link" destination="header.links"/>
        <move element="top.links" destination="customer"/>
        <move element="authorization-link" destination="top.links" after="-"/>
    </body>
</page>

I found that deleting the header.links section (and clearing the cache) caused the "Sign In" link to disappear and an error to be logged for the missing "customer" block:

main.WARNING: Broken reference: The element with the "customer" ID wasn't found. Verify the ID and try again.

(Not the exact same error though!)

So, I would ensure that this block is still represented in your default layout file, or any custom overrides for your theme (or any extensions). Then examine whatever template is configured for the block.

The default block file is vendor/magento/module-customer/Block/Account/AuthorizationLink.php

The default template file is vendor/magento/module-customer/view/frontend/templates/account/link/authorization.phtml

There isn't really a lot going on in either, so it seems most likely that the block is not being included at all.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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