Repository navigation
[6.x] Stache index cleanup - #15641
Merged
Merged
Conversation
Site now implements QueryableValue, so value indexes store the handle instead of a Site object. Site objects aren't in the cache's serializable classes allowlist, so a cached index would come back as __PHP_Incomplete_Class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Form wheres are intercepted by the submission query builder to pick which form stores to read, so the eagerly built index was never used for them. Other form queries will still build it lazily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Entries and terms return their locale for the queryable site value, so the regular value index can be used instead of the dedicated site index classes, which are now deprecated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Taxonomy wheres are intercepted by the term query builder to pick which taxonomy stores to read, so the eagerly built index was never used for them. Other taxonomy queries will still build it lazily. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleans up a few stache indexes that were storing whole objects or were never read.
Sites resolve to their handles
Sitenow implementsQueryableValue, returning its handle, the same wayBlueprintalready does.Without it, any value index that resolves a
site(e.g. the forms-2 submissionsiteindex, which goes through the genericValueindex) stores wholeSiteobjects. Those indexes are persisted to the Laravel cache, and whencache.serializable_classesis restricted (newer Laravel skeletons default it tofalse),Siteisn't on Statamic's allowlist. Any request that reads the cached index then gets__PHP_Incomplete_Classvalues and the query throws:Comparisons like
where('site', Site::selected())keep working sinceSitecasts to its handle.Entry and term site indexes
Entry::getQueryableValue('site')andLocalizedTerm::getQueryableValue('site')now return the locale directly, so theirsitestore indexes use the regular value index. This avoids resolving aSiteobject per item, and an item whose site was removed still indexes its locale rather thannull(same as before). The dedicatedIndexes\SiteandIndexes\Terms\Siteclasses are no longer used and have been marked deprecated.Unused indexes removed
The submission
formindex and termtaxonomyindex are removed.where/whereInon those columns are intercepted bySubmissionQueryBuilder/TermQueryBuilderto choose which child stores to read, so these eagerly built indexes (which held aForm/Taxonomyobject per item) were never used for them. Any other query on those columns will still build the index lazily on first use.Supersedes #15640.