[6.x] Add support for filtering conditions in Assets Tag#13936
Merged
jasonvarga merged 13 commits into6.xfrom Apr 8, 2026
Merged
[6.x] Add support for filtering conditions in Assets Tag#13936jasonvarga merged 13 commits into6.xfrom
jasonvarga merged 13 commits into6.xfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
The asset query builder already resolves custom fields by their plain
name, so the multi-field OR logic across data->{field} and
data->{site}->{field} was unnecessary. Assets are not localizable,
so the localized field test was also updated to reflect actual usage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of filtering by type after the query (which broke limit/paginate combinations), query against the extension field directly using whereIn. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Limit/offset are applied at the query level when there is no not_in param, and on the collection after filtering when not_in is present. Removed GetsQueryResults and OutputsItems traits since pagination and chunking are not needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s compatibility Co-Authored-By: Claude Opus 4.6 (1M context) <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.
References statamic/ideas#1003
Note
Medium Risk
Changes the assets tag’s core retrieval path from in-memory collection filtering to database/query-builder constraints, which may affect result ordering/edge cases and pagination behavior; covered by new tests but touches widely used template tag behavior.
Overview
The
assetstag now queries containers via an asset query builder (instead of fetching then filtering), enablingfield:conditionfiltering,query_scope, and query-level sorting/pagination/chunking via the shared tag concerns.Legacy params (
folder/recursive,type,not_in,sort,limit/offset) are preserved by applying them as query constraints where possible and as post-processing filters for collections/paginators/chunks. Adds a focusedAssetsTestsuite covering condition filtering (including localized fields), scopes, pagination output shape, and legacy behavior.Written by Cursor Bugbot for commit 6d4a4fb. This will update automatically on new commits. Configure here.