problem with cursorPaginate with order by column nullable #37482
Unanswered
MostafaRabia
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
HI!
I'm trying to order the questions based on last answer or last comment (for admin) using cursorPaginate (for speed, the data will be big in the future).
So for user:
->orderBy('last_answer', 'desc') ->orderBy('id', 'desc')
And good, working well.
In the admin:
->orderBy('last_comemnt', 'desc') ->orderBy('id', 'desc')
And cause a problem
Only arrays and objects are supported when cursor paginating items.
inIlluminate/Pagination/AbstractCursorPaginator.php:201
if he trying to reach page number 2.The columns are same, datetime nullable, the cursor is sending correctly, the select is *, I debuged
$item
thatgetParametersForItem
take, it's null.Why it's null? it causes if the
last_answer
orlast_comment
is null.Thanks.
Steps To Reproduce:
Just try to order by column that can be null, with another column that won't be ever null.
Beta Was this translation helpful? Give feedback.
All reactions