Skip to content

Commit

Permalink
Merge branch '5.x' into 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 18, 2024
2 parents 2cc08e6 + 14f2feb commit bb42fde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fixed a JavaScript error that could occur on element edit pages. ([#16055](https://github.com/craftcms/cms/issues/16055))
- Fixed a Twig deprecation error. ([#16107](https://github.com/craftcms/cms/issues/16107))
- Fixed a bug where `craft\services\Structures::fillGapsInElements()` wasn’t working properly if the elements weren’t passed in hierarchical order. ([#16085](https://github.com/craftcms/cms/issues/16085))
- Fixed a bug where `craft\helpers\Console::table()` wasn’t handling multi-byte characters and ANSI-formatted strings properly.
- Fixed a bug where entries could appear to retain old field values when switching entry types, even if the new type’s fields weret’t compatible with the original type’s fields. ([#16056](https://github.com/craftcms/cms/issues/16056))
- Fixed a bug where Link field query params weren’t working for elements that hadn’t been saved since updating to Craft 5.5.0+. ([#16113](https://github.com/craftcms/cms/issues/16113))
Expand Down
4 changes: 4 additions & 0 deletions src/services/Structures.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public function fillGapsInElements(array &$elements): void
$prevElement = null;
$patchedElements = [];

// https://github.com/craftcms/cms/issues/16085
// don't assume that elements are in the top to bottom order
usort($elements, fn(ElementInterface $a, ElementInterface $b) => $a->lft <=> $b->lft);

foreach ($elements as $i => $element) {
// Did we just skip any elements?
if (
Expand Down

0 comments on commit bb42fde

Please sign in to comment.