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

Ensure correctly sorted block children after unset some of them #1108

Merged
merged 1 commit into from
Sep 1, 2020

Conversation

lemundo-team
Copy link
Contributor

@lemundo-team lemundo-team commented Jul 13, 2020

Reset indices of block children array since they have gaps after unsetting blocks... this is causing wrong sort order

Description (*)

To "unset" blocks in layout XML is causing missing numbers in the array index of block children. This leads to wrong positions of child blocks (despite their attribute values of after/before in block definition) since the sort algorithm can not handle missing numbers in array index.

Manual testing scenarios (*)

  1. add several child blocks in layout XML by using attribute before="" or after=""
  2. unset at least two of them
  3. if you are lucky the sort order of child blocks is still correct (by accident) but depending on what blocks are unset it will be wrong (using xdebug will show more details)

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

…tting blocks... this is causing wrong sort order
@kiatng kiatng added the Component: Core Relates to Mage_Core label Jul 14, 2020
Copy link
Contributor

@sreichel sreichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested.

@sreichel sreichel added the bug label Aug 22, 2020
@kkrieger85 kkrieger85 merged commit ff4f46a into OpenMage:1.9.4.x Sep 1, 2020
@sreichel sreichel added this to the Release 19.4.7 / 20.0.3 milestone Sep 1, 2020
speedupmate pushed a commit to speedupmate/magento-lts that referenced this pull request Sep 16, 2020
…tting blocks... this is causing wrong sort order (OpenMage#1108)

Co-authored-by: Hannes Drittler <h.drittler@lemundo.de>
aldrahastur pushed a commit to aldrahastur/magento-lts that referenced this pull request Sep 22, 2020
…tting blocks... this is causing wrong sort order (OpenMage#1108)

Co-authored-by: Hannes Drittler <h.drittler@lemundo.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component: Core Relates to Mage_Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants