Skip to content

[6.x] Implement whereStatus() on search query builder#14387

Merged
jasonvarga merged 1 commit intostatamic:6.xfrom
ryanmitchell:fix/issue-11751
Mar 30, 2026
Merged

[6.x] Implement whereStatus() on search query builder#14387
jasonvarga merged 1 commit intostatamic:6.xfrom
ryanmitchell:fix/issue-11751

Conversation

@ryanmitchell
Copy link
Copy Markdown
Contributor

This PR adds whereStatus(string $status) to src/Search/QueryBuilder.php, which calls $this->where('status', $status). This works because:

  1. The IteratorBuilder's filterWhereBasic() calls ResolveValue on each result
  2. ResolveValue detects that Result implements ContainsQueryableValues and calls getQueryableValue('status')
  3. Result::getQueryableValue('status') (already implemented at Result.php:90) calls $this->searchable->status()

Closes #11751

@jasonvarga jasonvarga merged commit 2796e9e into statamic:6.x Mar 30, 2026
18 checks passed
@ryanmitchell ryanmitchell deleted the fix/issue-11751 branch March 30, 2026 14:33
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.

Error when filtering by status in collection search

2 participants