Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix querying statuses #279

Merged
merged 11 commits into from
May 3, 2024
Merged

Fix querying statuses #279

merged 11 commits into from
May 3, 2024

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented May 1, 2024

This pull request fixes an issue I ran into this morning when using the REST API alongside the Eloquent Driver.

Essentially, when the REST API queries to get entries, it filters for entries where status is published. However, when using the Eloquent Driver, no entries were being returned.

I've fixed this issue by copying over the recent changes around entry statuses to the Eloquent Driver (related: #9317).

The implementation is mostly the same as it is in Core. However, the main difference is the fact the Eloquent Driver's query builder doesn't maintain a $collections property to track the queried collection, instead we're just using $this->wheres()

To Do

  • Get the tests passing

@duncanmcclean duncanmcclean mentioned this pull request May 1, 2024
2 tasks
@duncanmcclean duncanmcclean marked this pull request as ready for review May 1, 2024 11:28
@jasonvarga
Copy link
Member

When building the status stuff in core, I was thinking that Eloquent driver extended that. I didn't realize we would need to copy over whereStatus and all the related methods.

I'm making a PR into core to extract it into a trait that'll make this PR much leaner.

@jasonvarga jasonvarga merged commit 966261f into statamic-5 May 3, 2024
21 checks passed
@jasonvarga jasonvarga deleted the fix/querying-statuses branch May 3, 2024 03:45
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.

3 participants