Skip to content

[6.x] Fix moved nav items reappearing after reordering children - #15198

Open
duncanmcclean wants to merge 1 commit into
6.xfrom
nav-moved-children
Open

[6.x] Fix moved nav items reappearing after reordering children#15198
duncanmcclean wants to merge 1 commit into
6.xfrom
nav-moved-children

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Aug 14, 2026

Copy link
Copy Markdown
Member

This pull request fixes an issue where a nav item moved out of its parent (like a collection moved to the top level of a section) would reappear under its original parent when the remaining children were reordered, resulting in the item being displayed twice. Clicking the moved item would also incorrectly highlight the original parent, since the resurrected child still matched the current URL. The same thing happened with hidden child items.

This was happening because when applying @modify preferences with reordered children, NavBuilder rebuilds the item's children from its original state — a snapshot taken before preferences are applied — which resurrects any children that earlier @move or @hide preferences had removed.

This PR fixes it by keeping track of items removed from their parent's children while preferences are applied, and excluding them when children are rebuilt from the original state.

Fixes #10831

…children

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Custom CP navigation displays collection unexpectedly after reordering collections

1 participant