Skip to content

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
@duncanmcclean duncanmcclean requested a review from jasonvarga May 1, 2024 11:30
@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
@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