Symfony Exception

LogicException

HTTP 500 Internal Server Error

Invalid item per page number. Limit: 10 and Page: 0, must be positive non-zero integers

Exception

LogicException

  1.     public function paginate($targetint $page 1int $limit null, array $options = []): PaginationInterface
  2.     {
  3.         $limit $limit ?? $this->defaultOptions[self::DEFAULT_LIMIT];
  4.         if ($limit <= || $page <= 0) {
  5.             throw new \LogicException("Invalid item per page number. Limit: $limit and Page: $page, must be positive non-zero integers");
  6.         }
  7.         $offset = ($page 1) * $limit;
  8.         $options = \array_merge($this->defaultOptions$options);
Paginator->paginate() in src/Troika/RealEstateBundle/Model/LotModel.php (line 832)
  1.     public function getEmptyPage()
  2.     {
  3.         return $this->paginator->paginate(
  4.           [],
  5.           0,
  6.           10
  7.         );
  8.     }
  9.     public function getFave($lots)
  10.     {
  1.     public function CustomFilterAction($alias)
  2.     {
  3.         $em $this->getDoctrine()->getEntityManager();
  4.         $filter $em->getRepository('TroikaMainBundle:FilterPreset')->findOneBy(['alias' => $alias]);
  5.         if ($filter) {
  6.             $lots $this->_model('lot')->getEmptyPage();
  7.             if ($filter->getTypeLot() && !$filter->getExclusive()) {
  8.                 switch ($filter->getTypeLot()->getId()) {
  9.                     case 1:
  10.                         $data = [
  11.                           'lots'          => $lots,
in vendor/symfony/http-kernel/HttpKernel.php->CustomFilterAction (line 169)
  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.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  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 web/app.php (line 52)
  1. // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
  2. //Request::enableHttpMethodParameterOverride();
  3.     $request Request::createFromGlobals();
  4.     try {
  5.         $response $kernel->handle($requestHttpKernelInterface::MASTER_REQUESTtrue); //$dev
  6.     } catch (Exception $e) {
  7.         if ($dev) {
  8.             if (property_exists($e'xdebug_message')) {
  9.                 $message $e->xdebug_message;
  10.             } else {

Logs 1

Level Channel Message
CRITICAL 13:41:43 request Uncaught PHP Exception LogicException: "Invalid item per page number. Limit: 10 and Page: 0, must be positive non-zero integers" at /home/troikaestate/public_html/vendor/knplabs/knp-components/src/Knp/Component/Pager/Paginator.php line 64
{
    "exception": {
        "xdebug_message": "<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> LogicException: Invalid item per page number. Limit: 10 and Page: 0, must be positive non-zero integers in /home/troikaestate/public_html/vendor/knplabs/knp-components/src/Knp/Component/Pager/Paginator.php on line <i>64</i></th></tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0001</td><td bgcolor='#eeeeec' align='right'>360336</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>0</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0058</td><td bgcolor='#eeeeec' align='right'>406736</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\Kernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $requestUri = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/web/app.php' bgcolor='#eeeeec'>.../app.php<b>:</b>52</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0874</td><td bgcolor='#eeeeec' align='right'>1100136</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handle( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $requestUri = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span>, <span>$catch = </span><span>TRUE</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/Kernel.php' bgcolor='#eeeeec'>.../Kernel.php<b>:</b>201</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0874</td><td bgcolor='#eeeeec' align='right'>1100928</td><td bgcolor='#eeeeec'>Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw( <span>$request = </span><span>class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = [...] }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = [...] }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = [...] }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = [...]; protected $cacheControl = [...] }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $requestUri = &#39;/map/elit_kvartiry_cvetnoy_bul_var&#39;; protected $baseUrl = &#39;&#39;; protected $basePath = NULL; protected $method = &#39;GET&#39;; protected $format = NULL; protected $session = class Closure { virtual $closure = &quot;$this-&gt;Symfony\\Component\\HttpKernel\\EventListener\\{closure}&quot; }; protected $locale = NULL; protected $defaultLocale = &#39;ru&#39;; private $preferredFormat = NULL; private $isHostValid = TRUE; private $isForwardedValid = TRUE }</span>, <span>$type = </span><span>1</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>81</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1194</td><td bgcolor='#eeeeec' align='right'>1679976</td><td bgcolor='#eeeeec'>Troika\\RealEstateBundle\\Controller\\FilterPresetController->CustomFilterAction( <span>$alias = </span><span>&#39;elit_kvartiry_cvetnoy_bul_var&#39;</span> )</td><td title='/home/troikaestate/public_html/vendor/symfony/http-kernel/HttpKernel.php' bgcolor='#eeeeec'>.../HttpKernel.php<b>:</b>169</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.2073</td><td bgcolor='#eeeeec' align='right'>3256352</td><td bgcolor='#eeeeec'>Troika\\RealEstateBundle\\Model\\LotModel->getEmptyPage(  )</td><td title='/home/troikaestate/public_html/src/Troika/RealEstateBundle/Controller/FilterPresetController.php' bgcolor='#eeeeec'>.../FilterPresetController.php<b>:</b>22</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.2073</td><td bgcolor='#eeeeec' align='right'>3256352</td><td bgcolor='#eeeeec'>Knp\\Component\\Pager\\Paginator->paginate( <span>$target = </span><span>[]</span>, <span>$page = </span><span>0</span>, <span>$limit = </span><span>10</span>, <span>$options = </span>??? )</td><td title='/home/troikaestate/public_html/src/Troika/RealEstateBundle/Model/LotModel.php' bgcolor='#eeeeec'>.../LotModel.php<b>:</b>832</td></tr>\n"
    }
}

Stack Trace

LogicException

LogicException:
Invalid item per page number. Limit: 10 and Page: 0, must be positive non-zero integers

  at vendor/knplabs/knp-components/src/Knp/Component/Pager/Paginator.php:64
  at Knp\Component\Pager\Paginator->paginate()
     (src/Troika/RealEstateBundle/Model/LotModel.php:832)
  at Troika\RealEstateBundle\Model\LotModel->getEmptyPage()
     (src/Troika/RealEstateBundle/Controller/FilterPresetController.php:22)
  at Troika\RealEstateBundle\Controller\FilterPresetController->CustomFilterAction()
     (vendor/symfony/http-kernel/HttpKernel.php:169)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:81)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (web/app.php:52)