Skip to content

[5.x]: fillGapsInElements not getting all elements #16085

@white-lukas

Description

@white-lukas

What happened?

Description

When trying to get all structure elements from an array of elements, The fillGapsInElements is not returning all elements from the structure, it's depending on the sort order of the given elements.

Example:
when passing in 2 elements into the function with the following structure:

  1. fietsen/heren/starters-racefiets/starters-racefiets
  2. fietsen/racefietsen/starters-racefiets

The lft value of the first element is 117, the second 14

When passing the elements in this order the returned array is missing the fietsen/racefietsen entry.

When I would change the order of the passed in elements the fietsen/racefietsen entry is returned as well

Craft CMS version

5.4.10.1

PHP version

8.3.13

Operating system and version

Ubuntu 24.04

Database type and version

mysql 8.0

Image driver and version

No response

Installed plugins and versions

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions