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

Undefined offset: 1 when using cursorPagination #38347

Closed
exzachlyvv opened this issue Aug 11, 2021 · 1 comment
Closed

Undefined offset: 1 when using cursorPagination #38347

exzachlyvv opened this issue Aug 11, 2021 · 1 comment

Comments

@exzachlyvv
Copy link

  • Laravel Version: 8.53.0
  • PHP Version: 7.4.21
  • Database Driver & Version: [email protected]

Description:

Prerequisite: In the database query, any column must have alias "x AS y". Note that "x as y" (lower case "as") will work.

When fetching page 2 and up while using cursorPagination, this stack trace is thrown:

ErrorException : Undefined offset: 1
vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php:358

Steps To Reproduce:

  1. Use cursorPagination on a database query that has an alias "x AS y"
  2. Fetch the first page, this will work
  3. Using the next page URL fetch the 2nd page <-- error thrown
@driesvints
Copy link
Member

We fixed this in #38251 so please update.

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

No branches or pull requests

2 participants