Skip to content

[6.x] Rebuild a collection's entries when its sites change - #15906

Open
edalzell wants to merge 2 commits into
statamic:6.xfrom
edalzell:fix/collection-sites-stache
Open

edalzell wants to merge 2 commits into
statamic:6.xfrom
edalzell:fix/collection-sites-stache

Conversation

@edalzell

Copy link
Copy Markdown
Contributor

Changing a collection's sites didn't refresh its Stache entries store. Entry paths are filtered by the collection's sites only when they're built, then cached, so CollectionSaved listeners (and the rest of the request) still got entries from the old sites. With the watcher off it stayed wrong until stache:refresh.

The Stache CollectionRepository::save() now clears that collection's entries store when sites is dirty, so it rebuilds with the new sites on next use.

The test uses a serializing cache store: the plain array store hands back the collection being saved, and fetching it resets its dirty state mid-save.

Closes #10344

@edalzell
edalzell marked this pull request as ready for review November 15, 2026 00:21

This branch has not been deployed

No deployments
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.

Stache is refreshed too late

1 participant