Skip to content

Commit

Permalink
reset indices of block children array since they have gaps after unse…
Browse files Browse the repository at this point in the history
…tting blocks... this is causing wrong sort order (OpenMage#1108)

Co-authored-by: Hannes Drittler <h.drittler@lemundo.de>
  • Loading branch information
lemundo-team and lemhannes authored Sep 1, 2020
1 parent 5e0a74f commit ff4f46a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/code/core/Mage/Core/Block/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ public function insert($block, $siblingName = '', $after = false, $alias = '')
*/
public function sortChildren($force = false)
{
$this->_sortedChildren = array_values($this->_sortedChildren); // reset indexes which might have gaps after unsetting blocks
foreach ($this->_sortInstructions as $name => $list) {
list($siblingName, $after, $exists) = $list;
if ($exists && !$force) {
Expand Down

0 comments on commit ff4f46a

Please sign in to comment.