Symfony Exception

ContextErrorException

HTTP 500 Internal Server Error

Notice: Undefined index: url

Exception

Symfony\Component\Debug\Exception\ ContextErrorException

  1.             WHERE m.url = ?',
  2.             [(string) $url]
  3.         );
  4.         
  5.         $link FrontendNavigation::getUrlForBlock('Swan');
  6.         $item['full_url'] = $link."/".$item['url'];
  7.         if($item['ibname'] != ''$item['name'] = $item['ibname'];
  8.         
  9.         if($item['parent_id'] != 2) {
  10.             $item['parent'] = self::getCategoryById($item['parent_id']);
  11.         }
Model::getCategory('kantoor-muse-176') in src/Frontend/Modules/Swan/Actions/Index.php (line 31)
  1.     private function getData(): void
  2.     {
  3.         $category_url $this->url->getParameter(0);
  4.         $product_url $this->url->getParameter(1);
  5.         
  6.         $this->category FrontendSwanModel::getCategory($category_url);
  7.         
  8.         if($product_url != '') {
  9.             $this->product FrontendSwanModel::get($product_url);
  10.             $this->product["description"] = str_replace("\n","<br>",$this->product["description"]);
  11.         }
Index->getData() in src/Frontend/Modules/Swan/Actions/Index.php (line 22)
  1.     
  2.     public function execute(): void
  3.     {
  4.         parent::execute();
  5.         $this->loadTemplate();
  6.         $this->getData();
  7.         $this->parse();
  8.     }
  9.     private function getData(): void
  10.     {
Index->execute() in src/Frontend/Core/Engine/Block/ExtraInterface.php (line 126)
  1.         if (!is_callable([$this->object'execute'])) {
  2.             throw new FrontendException('The action file should contain a callable method "execute".');
  3.         }
  4.         // call the execute method of the real action (defined in the module)
  5.         $this->object->execute();
  6.         // set some properties
  7.         $this->setOverwrite($this->object->getOverwrite());
  8.         if ($this->object->getTemplatePath() !== null) {
  9.             $this->setTemplatePath($this->object->getTemplatePath());
ExtraInterface->execute() in src/Frontend/Core/Engine/Page.php (line 367)
  1.             }
  2.             return $parsedBlock;
  3.         }
  4.         $block['extra']->execute();
  5.         $extraVariables $block['extra']->getTemplate()->getAssignedVariables();
  6.         $block['extra']->getTemplate()->assignArray($mainVariables);
  7.         $block['extra']->getTemplate()->assignArray($extraVariables);
  8.         return [
Page->parseBlock(array('extra' => object(ExtraInterface)), array()) in src/Frontend/Core/Engine/Page.php (line 346)
  1.         // loop all positions
  2.         foreach ($this->record['positions'] as $position => $blocks) {
  3.             // loop all blocks in this position
  4.             foreach ($blocks as $i => $block) {
  5.                 $positions[$position][$i] = $this->parseBlock($block$mainVariables);
  6.             }
  7.             // assign position to template
  8.             $this->template->assign('position' . \SpoonFilter::ucfirst($position), $positions[$position]);
  9.         }
Page->parsePositions() in src/Frontend/Core/Engine/Page.php (line 199)
  1.                 'cookieBarHide',
  2.                 !$this->get('fork.settings')->get('Core''show_cookie_bar'false)
  3.                 || $this->getContainer()->get('fork.cookie')->hasHiddenCookieBar()
  4.             );
  5.             $this->parsePositions();
  6.             // assign empty positions
  7.             $unusedPositions array_diff(
  8.                 $this->record['template_data']['names'],
  9.                 array_keys($this->record['positions'])
Page->display() in src/Frontend/Core/Engine/Frontend.php (line 25)
  1.     /**
  2.      * @return Response
  3.      */
  4.     public function display(): Response
  5.     {
  6.         return $this->page->display();
  7.     }
  8.     /**
  9.      * Initializes the entire frontend; preload FB, URL, template and the requested page.
  10.      *
Frontend->display() in app/ForkController.php (line 106)
  1.         $application->passContainerToModels();
  2.         try {
  3.             $application->initialize();
  4.             return $application->display();
  5.         } catch (RedirectException $ex) {
  6.             return $ex->getResponse();
  7.         } catch (Twig_Error $twigError) {
  8.             if ($twigError->getPrevious() instanceof RedirectException) {
  9.                 return $twigError->getPrevious()->getResponse();
ForkController->handleApplication(object(Frontend)) in app/ForkController.php (line 80)
  1.         defined('APPLICATION') || define('APPLICATION''Frontend');
  2.         $applicationClass $this->initializeFrontend('Frontend');
  3.         $application = new $applicationClass($this->container->get('kernel'));
  4.         return $this->handleApplication($application);
  5.     }
  6.     /**
  7.      * Runs the frontend ajax requests
  8.      */
ForkController->frontendController() in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 151)
  1.         $this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS$event);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response = \call_user_func_array($controller$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new GetResponseForControllerResultEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch(KernelEvents::VIEW$event);
HttpKernel->handleRaw(object(Request), 1) in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php (line 68)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level'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) {
HttpKernel->handle(object(Request), 1, true) in app/Kernel.php (line 53)
  1.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true): Response
  2.     {
  3.         // boot if it hasn't booted yet
  4.         $this->boot();
  5.         return $this->getHttpKernel()->handle($request$type$catch);
  6.     }
  7.     /**
  8.      * Boot and define the Fork Constants.
  9.      */
Kernel->handle(object(Request)) in /index.php (line 63)
  1. if ($debug) {
  2.     Debug::enable();
  3. }
  4. $kernel = new AppKernel($env$debug);
  5. $response $kernel->handle($request);
  6. if ($response->getCharset() === null && $kernel->getContainer() instanceof ContainerInterface) {
  7.     $response->setCharset(
  8.         $kernel->getContainer()->getParameter('kernel.charset')
  9.     );
  10. }

Logs

No log messages

Stack Trace

ContextErrorException

Symfony\Component\Debug\Exception\ContextErrorException:
Notice: Undefined index: url

  at src/Frontend/Modules/Swan/Engine/Model.php:108
  at Frontend\Modules\Swan\Engine\Model::getCategory('kantoor-muse-176')
     (src/Frontend/Modules/Swan/Actions/Index.php:31)
  at Frontend\Modules\Swan\Actions\Index->getData()
     (src/Frontend/Modules/Swan/Actions/Index.php:22)
  at Frontend\Modules\Swan\Actions\Index->execute()
     (src/Frontend/Core/Engine/Block/ExtraInterface.php:126)
  at Frontend\Core\Engine\Block\ExtraInterface->execute()
     (src/Frontend/Core/Engine/Page.php:367)
  at Frontend\Core\Engine\Page->parseBlock(array('extra' => object(ExtraInterface)), array())
     (src/Frontend/Core/Engine/Page.php:346)
  at Frontend\Core\Engine\Page->parsePositions()
     (src/Frontend/Core/Engine/Page.php:199)
  at Frontend\Core\Engine\Page->display()
     (src/Frontend/Core/Engine/Frontend.php:25)
  at Frontend\Core\Engine\Frontend->display()
     (app/ForkController.php:106)
  at ForkCMS\App\ForkController->handleApplication(object(Frontend))
     (app/ForkController.php:80)
  at ForkCMS\App\ForkController->frontendController()
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (app/Kernel.php:53)
  at ForkCMS\App\Kernel->handle(object(Request))
     (index.php:63)