Bug description
When using a more advanced route configuration, duplicate slugs are allowed (i.e. entries at a depth of greater than 1 in an ordered collection can share the same slug).
This leads to only one of the entries being accessible.
How to reproduce
- Install Statamic 6
- Create a new Collection, and set the Route as
{{ if depth > 1 }}{{ parent_uri }}/{{ slug }}{{ else }}manual-mount/{{ slug }}{{ /if }}
- Create an Entry (i.e. call it Root) - ✅ saves correctly
- Create another Entry with the same slug - ✅ validation kicks in correctly
- Create a child to the first Entry, such as "Child" (slug becomes
child) - ✅ saves correctly
- Create another child entry to the first Entry, make the slug be
child - ❌ saves (but validation should prevent this)
This route config is a little odd but is required given the site setup here with the depth 0 unable to be explicitly mounted. It must be nested so has a hardcoded base route with a slug, but for depth > 1, then is on the parent.
Logs
Environment
Environment
Laravel Version: 13.4.0
PHP Version: 8.4.19
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.12.0 PRO
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Bug description
When using a more advanced route configuration, duplicate slugs are allowed (i.e. entries at a depth of greater than 1 in an ordered collection can share the same slug).
This leads to only one of the entries being accessible.
How to reproduce
{{ if depth > 1 }}{{ parent_uri }}/{{ slug }}{{ else }}manual-mount/{{ slug }}{{ /if }}child) - ✅ saves correctlychild- ❌ saves (but validation should prevent this)This route config is a little odd but is required given the site setup here with the depth 0 unable to be explicitly mounted. It must be nested so has a hardcoded base route with a slug, but for depth > 1, then is on the parent.
Logs
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response