Skip to content

[6.x] Fix element query clones not being able to apply new criteria#18826

Merged
brandonkelly merged 2 commits into
6.xfrom
rias/cms-2064-6x-element-index-page-for-structure-maxlevels-1-section
May 11, 2026
Merged

[6.x] Fix element query clones not being able to apply new criteria#18826
brandonkelly merged 2 commits into
6.xfrom
rias/cms-2064-6x-element-index-page-for-structure-maxlevels-1-section

Conversation

@riasvdv
Copy link
Copy Markdown
Contributor

@riasvdv riasvdv commented May 11, 2026

Description

Fixes #18825

Fixed a query cloning bug where ElementQuery clones created after execution could retain their prepared internal state. That meant criteria added to the clone, such as descendantOf(), could be ignored.

This caused Structure element indexes to count all rows as descendants when rendering child toggles, so max-level-1 Structure entries could incorrectly show carets. Cloned executed queries now restore their unprepared query state before being further narrowed.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 11, 2026

CMS-2064

@riasvdv riasvdv marked this pull request as ready for review May 11, 2026 11:42
@riasvdv riasvdv requested a review from brandonkelly May 11, 2026 11:43
@brandonkelly brandonkelly merged commit 4c018fb into 6.x May 11, 2026
18 checks passed
@brandonkelly brandonkelly deleted the rias/cms-2064-6x-element-index-page-for-structure-maxlevels-1-section branch May 11, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants