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

Collection Engine Undefined array key 0 error #584

Closed
amir9480 opened this issue Feb 15, 2022 · 0 comments · Fixed by #585
Closed

Collection Engine Undefined array key 0 error #584

amir9480 opened this issue Feb 15, 2022 · 0 comments · Fixed by #585

Comments

@amir9480
Copy link
Contributor

  • Scout Version: 9.4
  • Scout Driver: Collection
  • PHP Version: 8.1

Description:

When using collection engine and paginate with query callback together Undefined array key 0 error exception happens.

Steps To Reproduce:

  1. Make a searchable model and change SCOUT_ENGINE to collection
  2. Perform a search on the model with a query callback and use paginate to get results. (without query callback, everything works fine.)
SearchableUserModel::search('laravel')->query($queryFunction)->paginate();
  1. Now go to page 2, on page 1 everything also works fine.
  2. Now you should see ErrorException: Undefined array key 0 at https://github.com/laravel/scout/blob/v9.4.3/src/Engines/CollectionEngine.php#L170
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 a pull request may close this issue.

1 participant