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

does not support cursorPaginate method #2312

Closed
farmani opened this issue Aug 28, 2021 · 1 comment · Fixed by #2362
Closed

does not support cursorPaginate method #2312

farmani opened this issue Aug 28, 2021 · 1 comment · Fixed by #2362
Assignees
Labels

Comments

@farmani
Copy link

farmani commented Aug 28, 2021

  • Laravel-mongodb Version: 3.8.4
  • PHP Version: 8.0.9
  • Database Driver & Version: 4.4

Description:

$query->cursorPaginate(10) return error

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

Expected behaviour

paginate() works fine but cursorPaginate return error. the reason in flipping parameters property to generate next link

Actual behaviour

cursorPaginate return error

Logs: [2021-08-28 14:47:39] local.ERROR: array_flip(): Can only flip string and integer values, entry skipped {"exception":"[object] (ErrorException(code: 0): array_flip(): Can only flip string and integer values, entry skipped at /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:382) [stacktrace] #0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError() #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(382): array_flip() #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php(199): Illuminate\\Support\\Collection->flip() #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php(185): Illuminate\\Pagination\\AbstractCursorPaginator->getParametersForItem() #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php(173): Illuminate\\Pagination\\AbstractCursorPaginator->getCursorForItem() #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Pagination/AbstractCursorPaginator.php(139): Illuminate\\Pagination\\AbstractCursorPaginator->nextCursor() #6 /var/www/core/src/Api/V1/Resources/MediaCollection.php(25): Illuminate\\Pagination\\AbstractCursorPaginator->nextPageUrl() #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php(95): Aparlay\\Core\\Api\\V1\\Resources\\MediaCollection->toArray() #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Resources/Json/JsonResource.php(232): Illuminate\\Http\\Resources\\Json\\JsonResource->resolve() #9 [internal function]: Illuminate\\Http\\Resources\\Json\\JsonResource->jsonSerialize() #10 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Response.php(106): json_encode() #11 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Response.php(58): Illuminate\\Http\\Response->morphToJson() #12 /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Response.php(35): Illuminate\\Http\\Response->setContent() #13 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(55): Illuminate\\Http\\Response->__construct() #14 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(711): Illuminate\\Routing\\ResponseFactory->make() #15 /var/www/core/src/Api/V1/Controllers/Controller.php(40): response() #16 /var/www/core/src/Api/V1/Controllers/MediaController.php(33): Aparlay\\Core\\Api\\V1\\Controllers\\Controller->response() #17 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Aparlay\\Core\\Api\\V1\\Controllers\\MediaController->index() #18 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction() #19 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(261): Illuminate\\Routing\\ControllerDispatcher->dispatch() #20 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(204): Illuminate\\Routing\\Route->runController() #21 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Routing\\Route->run() #22 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}() #23 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #24 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle() #25 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #26 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(103): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequest() #27 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(55): Illuminate\\Routing\\Middleware\\ThrottleRequests->handleRequestUsingNamedLimiter() #28 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\ThrottleRequests->handle() #29 /var/www/html/app/Http/Middleware/ResponseFormatter.php(43): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #30 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\ResponseFormatter->handle() #31 /var/www/html/vendor/beyondcode/laravel-server-timing/src/Middleware/ServerTimingMiddleware.php(36): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #32 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): BeyondCode\\ServerTiming\\Middleware\\ServerTimingMiddleware->handle() #33 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #34 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\\Pipeline\\Pipeline->then() #35 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\\Routing\\Router->runRouteWithinStack() #36 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute() #37 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute() #38 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch() #39 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}() #40 /var/www/html/vendor/aparlay/nova/src/Http/Middleware/ServeNova.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #41 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle() #42 /var/www/html/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #43 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle() #44 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #45 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #46 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle() #47 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #48 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #49 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle() #50 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #51 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle() #52 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #53 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle() #54 /var/www/html/vendor/fruitcake/laravel-cors/src/HandleCors.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #55 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\\Cors\\HandleCors->handle() #56 /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #57 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\\Proxy\\TrustProxies->handle() #58 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #59 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then() #60 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter() #61 /var/www/html/vendor/laravel/octane/src/ApplicationGateway.php(36): Illuminate\\Foundation\\Http\\Kernel->handle() #62 /var/www/html/vendor/laravel/octane/src/Worker.php(92): Laravel\\Octane\\ApplicationGateway->handle() #63 /var/www/html/vendor/laravel/octane/bin/swoole-server(117): Laravel\\Octane\\Worker->handle() #64 [internal function]: {closure}() #65 /var/www/html/vendor/laravel/octane/bin/swoole-server(163): Swoole\\Server->start() #66 {main} "}
@mikrahub
Copy link

mikrahub commented Dec 2, 2021

Same problem, any available fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants