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

[10.x] Fix error when using orderByRaw() in query before using cursorPaginate() #51023

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

axlon
Copy link
Contributor

@axlon axlon commented Apr 11, 2024

This is a backport of #50887 as the problem that PR fixed is also present in Laravel 10

Original PR description:

When using orderByRaw with a custom query, you get this error message:

Error: array_flip(): Can only flip string and integer values, entry skipped

This is because orderByRaw will add null to $this->parameters resulting in the above error.

Adding filter ensures that null entries are automatically removed before the flip operation.

Full credits to @ngunyimacharia for the original fix

@taylorotwell taylorotwell merged commit 2c4746a into laravel:10.x Apr 11, 2024
26 checks passed
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.

2 participants