Symfony Exception

OutOfRangeCurrentPageException

HTTP 500 Internal Server Error

Page "2" does not exist. The currentPage must be inferior to "1"

Exception

Pagerfanta\Exception\ OutOfRangeCurrentPageException

  1.     {
  2.         if ($this->getNormalizeOutOfRangePages()) {
  3.             return $this->getNbPages();
  4.         }
  5.         throw new OutOfRangeCurrentPageException(sprintf('Page "%d" does not exist. The currentPage must be inferior to "%d"'$currentPage$this->getNbPages()));
  6.     }
  7.     private function resetForCurrentPageChange(): void
  8.     {
  9.         $this->currentPageResults null;
in vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php -> normalizeOutOfRangeCurrentPage (line 265)
  1.      * @param int $currentPage
  2.      */
  3.     private function filterOutOfRangeCurrentPage($currentPage): int
  4.     {
  5.         if ($this->notAllowedCurrentPageOutOfRange($currentPage)) {
  6.             return $this->normalizeOutOfRangeCurrentPage($currentPage);
  7.         }
  8.         return $currentPage;
  9.     }
in vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php -> filterOutOfRangeCurrentPage (line 237)
  1.      */
  2.     private function filterCurrentPage($currentPage): int
  3.     {
  4.         $currentPage $this->toInteger($currentPage);
  5.         $this->checkCurrentPage($currentPage);
  6.         $currentPage $this->filterOutOfRangeCurrentPage($currentPage);
  7.         return $currentPage;
  8.     }
  9.     /**
  1.     {
  2.         if (\count(\func_get_args()) > 1) {
  3.             $this->useDeprecatedCurrentPageBooleanArguments(\func_get_args());
  4.         }
  5.         $this->currentPage $this->filterCurrentPage($currentPage);
  6.         $this->resetForCurrentPageChange();
  7.         return $this;
  8.     }
  1.             // don't change the following line (you did that twice in the past and broke everything)
  2.             $paginator = new Pagerfanta(new DoctrineORMAdapter($querytruefalse));
  3.         }
  4.         $paginator->setMaxPerPage($maxPerPage);
  5.         $paginator->setCurrentPage($page);
  6.         return $paginator;
  7.     }
  8.     /**
  1.             'query_builder' => $queryBuilder,
  2.             'sort_field' => $sortField,
  3.             'sort_direction' => $sortDirection,
  4.         ]);
  5.         return $this->get('easyadmin.paginator')->createOrmPaginator($queryBuilder$page$maxPerPage);
  6.     }
  7.     /**
  8.      * Creates Query Builder instance for all the records.
  9.      *
  1.     protected function listAction()
  2.     {
  3.         $this->dispatch(EasyAdminEvents::PRE_LIST);
  4.         $fields $this->entity['list']['fields'];
  5.         $paginator $this->findAll($this->entity['class'], $this->request->query->get('page'1), $this->entity['list']['max_results'], $this->request->query->get('sortField'), $this->request->query->get('sortDirection'), $this->entity['list']['dql_filter']);
  6.         $this->dispatch(EasyAdminEvents::POST_LIST, ['paginator' => $paginator]);
  7.         $parameters = [
  8.             'paginator' => $paginator,
  1.         if (!method_exists($this$methodName)) {
  2.             throw new \BadMethodCallException(sprintf('The "%s()" method does not exist in the %s class'$methodName, static::class));
  3.         }
  4.         return \call_user_func_array([$this$methodName], $arguments);
  5.     }
  6.     /**
  7.      * Generates the backend homepage and redirects to it.
  8.      */
  1.             if (false === $userHasPermission) {
  2.                 throw new NoPermissionException(['action' => $action'entity_name' => $this->entity['name'], 'entity_id' => $id]);
  3.             }
  4.         }
  5.         return $this->executeDynamicMethod($action.'<EntityName>Action');
  6.     }
  7.     /**
  8.      * Utility method which initializes the configuration of the entity on which
  9.      * the user is performing the action.
in vendor/symfony/http-kernel/HttpKernel.php -> indexAction (line 157)
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $requestint $type HttpKernelInterface::MASTER_REQUESTbool $catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
Kernel->handle() in public/index.php (line 24)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

OutOfRangeCurrentPageException

Pagerfanta\Exception\OutOfRangeCurrentPageException:
Page "2" does not exist. The currentPage must be inferior to "1"

  at vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php:292
  at Pagerfanta\Pagerfanta->normalizeOutOfRangeCurrentPage()
     (vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php:265)
  at Pagerfanta\Pagerfanta->filterOutOfRangeCurrentPage()
     (vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php:237)
  at Pagerfanta\Pagerfanta->filterCurrentPage()
     (vendor/pagerfanta/pagerfanta/lib/Core/Pagerfanta.php:191)
  at Pagerfanta\Pagerfanta->setCurrentPage()
     (vendor/easycorp/easyadmin-bundle/src/Search/Paginator.php:41)
  at EasyCorp\Bundle\EasyAdminBundle\Search\Paginator->createOrmPaginator()
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:690)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->findAll()
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:182)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->listAction()
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:912)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->executeDynamicMethod()
     (vendor/easycorp/easyadmin-bundle/src/Controller/AdminControllerTrait.php:86)
  at EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController->indexAction()
     (vendor/symfony/http-kernel/HttpKernel.php:157)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:195)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:24)