Custom CP navigation displays collection unexpectedly after reordering collections
Bug description
I have three collections and have moved the 'Seiten' collection one level up. When I click on 'Collection (Sammlungen)' in the CP navigation, only the other two are displayed under the word 'Collection', as the third 'Seiten' has been moved. Up to this point, this is also the behaviour I expect. → See Screenshot 1
But if I change the order of the two remaining entries – 'Events' should be first, 'Eventcodes' second - the 'Pages' collection suddenly reappears in the CP nav under 'Collections'. 'Seiten' is displayed twice: under ‘Collection’ and also one level higher. I would expect it to be displayed only once. → See Screenshot 2 and 3.
I have also noticed that without reordering, clicking on the top-level ‘Seiten’ does not open ‘Collections’, but after reordering, ‘Collection’ also opens when I click on the top-level ‘Seiten. I tried to hide the collection, but it hides them on toplevel too.
I made this changes in the default preferences.yaml via CP. The code generated by the CP is:
nav:
content:
reorder: true
items:
'content::collections::seiten':
action: '@move'
icon: sites
display: Pages
'content::collections':
action: '@modify'
reorder: true
children:
'content::collections::events': '@inherit'
'content::collections::eventcodes': '@inherit'
How to reproduce
- You need at least 3 collections.
- Move one collection up to top-level
- Reorder the other twos in the 'Collection' tree
- Click on the collection on top-level or on 'Collection' in the nav tree.
Logs
No response
Environment
Environment
Application Name: Kochort CMS
Laravel Version: 11.23.5
PHP Version: 8.3.11
Composer Version: 2.7.7
Environment: local
Debug Mode: ENABLED
URL: /
Maintenance Mode: OFF
Timezone: Europe/Zurich
Locale: de_CH
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file
Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.25.0 PRO
Statamic Addons
mitydigital/statamic-sticky-notes: 1.0.2
statamic/seo-pro: 6.1.2
stillat/relationships: 2.2.1
swiftmade/statamic-clear-assets: 3.1.0
Installation
Fresh statamic/statamic site via CLI
Additional details
No response