Skip to content

SortOrder is reversed in layout XML #27162

Open
@krisztian-fekete

Description

@krisztian-fekete

Preconditions (*)

  1. Magento Commerce 2.3.3

Steps to reproduce (*)

  1. Add a child block with sortOrder value of 1 in your layout XML, e.g., Magento_Customer/layout/customer_account.xml in your custom theme:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Customer\Block\Account\SortLinkInterface" name="customer-account-navigation-logout-link">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Logout</argument>
                    <argument name="path" xsi:type="string">account/logout</argument>
                    <argument name="sortOrder" xsi:type="number">1</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>
  1. Flush the layout and full page caches
  2. Log in at the front end and navigate to /customer/account/

Expected result (*)

  1. A new, Logout link should appear in the left sidebar at the very top.

Actual result (*)

  1. A new, Logout link appears at the very bottom instead.

My understanding is that the lower the sortOrder value is, the higher up the item should be rendered in the list. It seems to be reversed.

Seems similar to:

#5849

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: AccountComponent: CustomerComponent: XmlFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: ready for devReported on 2.3.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions