0

Getting Error after upgrading Magento 2.1.9 to Magento 2.2.2. It seems there is some issue in layout validation. Can't figure it out how exactly I should fix it?. Any help would be appreciated enter image description here

Here is my theme/default.xml file:

<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="top.links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-dashboard-link-top" after="my-account-link" >
            <arguments>
                <argument name="path" xsi:type="string">customer/account</argument>
                <argument name="label" xsi:type="string" translate="true">My Dashboard</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link-top" after="customer-account-navigation-dashboard-link-top" >
            <arguments>
                <argument name="path" xsi:type="string">sales/order/history</argument>
                <argument name="label" xsi:type="string" translate="true">Past Orders</argument>
            </arguments>
        </block>
    </referenceBlock>
    <referenceBlock name="header.container">
        <block class="Magento\Framework\View\Element\Template" name="popup" before="-" template="Magento_Theme::popup/home_popup.phtml"/>
    </referenceBlock>
    <block class="Magento\Customer\Block\Account\Link" name="my-account-link">
        <arguments>
            <argument name="label" xsi:type="string" translate="true">My Account</argument>
            <argument name="class" xsi:type="string">sign-in</argument>
        </arguments>
    </block>
    <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link" template="account/link/authorization.phtml"/>

     <referenceBlock name="header.links">
        <block class="Magento\Framework\View\Element\Html\Link" destination="header.links" name="about"  before="top.links">
            <arguments>
                <argument name="label" xsi:type="string">About Us</argument>
                <argument name="path" xsi:type="string">about_us</argument>
                <argument name="class" xsi:type="string">about-us</argument>
            </arguments>
        </block>

        <block class="Magento\Framework\View\Element\Html\Link" destination="header.links" name="help"  before="top.links">
            <arguments>
                <argument name="label" xsi:type="string">How to Order</argument>
                <argument name="path" xsi:type="string">how-order</argument>
                <argument name="class" xsi:type="string">how-to-order</argument>
            </arguments>
        </block>

        <block class="Magento\Framework\View\Element\Html\Link" destination="header.links" name="contact-us"  before="top.links">
            <arguments>
                <argument name="label" xsi:type="string">Contact Us</argument>
                <argument name="path" xsi:type="string">contact-us</argument>
                <argument name="class" xsi:type="string">contact-us</argument>
            </arguments>
        </block>

        <!-- <block class="Magento\Framework\View\Element\Html\Link" destination="header.links" name="sign-in"  before="top.links">
            <arguments>
                <argument name="label" xsi:type="string">Sign In</argument>
                <argument name="path" xsi:type="string">customer/account/login</argument>
                <argument name="class" xsi:type="string">sign-in</argument>
            </arguments>
        </block> -->
        <move element="authorization-link" destination="header.links" before="top.links" />
        <move element="minicart" destination="header.links" after="top.links"/>


        <referenceBlock name="register-link" remove="true" /> 
    </referenceBlock>
    <referenceBlock name="authorization-link-login" remove="true" /> 
    <referenceContainer name="sidebar.main">
        <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav.aside" template="html/topmenu-aside.phtml" ttl="3600" before="-"/>
    </referenceContainer>
    <referenceBlock name="header-wrapper" after="-">
        <block class="Magento\Framework\View\Element\Template" name="new.topsearch" template="Magento_Theme::html/form.new.phtml" before="logo"/>
        <block class="Magento\Framework\View\Element\Html\Link" before="logo" name="new-sign-in"  >
            <arguments>
                <argument name="label" xsi:type="string">Sign In</argument>
                <argument name="path" xsi:type="string">customer/account/login</argument>
                <argument name="class" xsi:type="string">new-sign-in</argument>
            </arguments>
        </block>
        <block class="Magento\Framework\View\Element\Html\Link" before="logo" name="new-sign-in"  >
            <arguments>
                <argument name="label" xsi:type="string">Sign Out</argument>
                <argument name="path" xsi:type="string">customer/account/logout</argument>
                <argument name="class" xsi:type="string">new-sign-out</argument>
            </arguments>
        </block>
   </referenceBlock>
</body>

2
  • Could you show me your default.xml file? Commented Feb 2, 2018 at 10:09
  • @RakeshJesadiya: I have updated the default.xml file. please check Commented Feb 2, 2018 at 11:35

1 Answer 1

1

As your error log says, remove destination attribute from your blocks, i.e ( destination="header.links" ).

destination attribute is normally used with where you define which element to move and where to move adding destination="".

remove destination from all blocks in your layout hope it will fix the issue.

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.