Skip to content

[6.x] Fix uri index for new entries in orderable collections - #15189

Open
duncanmcclean wants to merge 1 commit into
6.xfrom
orderable-entry-uris
Open

[6.x] Fix uri index for new entries in orderable collections#15189
duncanmcclean wants to merge 1 commit into
6.xfrom
orderable-entry-uris

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where new entries in an orderable collection (a structure with a max_depth of 1) would 404 on the front end until they were saved a second time.

This was happening because uri was being updated before collectionHandle and site in CollectionEntriesStore::storeIndexes(). Entries in orderable collections never get written to the tree file, so CollectionStructure::validateTree() reconciles the tree by querying the collection's entries. At the point the uri index was updated, the entry being saved wasn't yet visible to that query, so no page was found for it and null got cached as its uri. Saving a second time worked because the entry was in the other indexes by then.

This PR fixes it by moving uri after the indexes that query relies on, alongside parent, which is resolved from the structure too. This also fixes the order index, which was landing on 1 for every new entry.

Fixes #11534

`uri` was being updated before `collectionHandle` and `site` in
`CollectionEntriesStore::storeIndexes()`. entries in orderable collections
aren't written to the tree file, so `CollectionStructure::validateTree()`
queries the collection's entries to reconcile it - and that query couldn't
see the entry being saved, leaving `null` cached as its uri (and `1` as its
order) until the entry was saved a second time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@duncanmcclean duncanmcclean changed the title [6.x] Fix uri index for new entries in orderable collections [6.x] Fix uri index for new entries in orderable collections Aug 13, 2026
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.

404 error when updating entries when max_depth is 1

1 participant