Skip to content

[6.x] Pass active query scope handles to relationship index scopes#14883

Open
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/relationship-query-scope-handles
Open

[6.x] Pass active query scope handles to relationship index scopes#14883
mynetx wants to merge 1 commit into
statamic:6.xfrom
mynetx:fix/relationship-query-scope-handles

Conversation

@mynetx

@mynetx mynetx commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

An entries/relationship field with query_scopes applies each scope with $request->all() during the CP index (the entry picker), but that never includes the list of active scope handles. A scope registered under multiple aliases — one class backing several handles — can't tell which one is in effect, so it can't apply the right filter.

Relationship::applyIndexQueryScopes() now merges the field's configured handles into the params as queryScopes, the same way the asset browser passes them.

Fixes #14204

The entries/relationship fieldtype index applied each configured query
scope with the raw request params, which never included the list of
active scope handles. A scope registered under multiple aliases couldn't
tell which one was in effect. Merge the configured handles into the
params as queryScopes, the same way the asset browser does.
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.

Query scopes used by relationship/entries fieldtype don't receive queryScopes in params

1 participant