Symfony Exception

ContextErrorException

HTTP 500 Internal Server Error

Notice: Undefined index: profile_id

Exception

Symfony\Component\Debug\Exception\ ContextErrorException

  1.              LEFT JOIN location AS l on i.id = l.advertisement_id
  2.              WHERE i.status = ? AND i.language = ? AND i.hidden = ? AND i.publish_on <= ? AND m.url = ?
  3.              LIMIT 1',
  4.             ['active'LANGUAGEfalseWebModel::getUTCDate('Y-m-d H:i'), $url]
  5.         );
  6.         if ($advertisementPost['profile_id'])
  7.             $advertisementPost['profile'] = Profiles::getSettings($advertisementPost['profile_id']);
  8.         else {
  9.             $advertisementPost['profile'] = [];
  10.         }
  11.         $advertisementPost['open_hours'] = json_decode($advertisementPost['open_hours']);
Advertisement::get('oz-erciyes-halal') in src/Web/Modules/Advertisement/Controller/Detail.php (line 58)
  1.         if ($this->url->getParameter(1) === null) {
  2.             throw new NotFoundHttpException();
  3.         }
  4.         if ($this->url->getParameter('revision''int') === null) {
  5.             return $this->completeAdvertisementPost(WebAdvertisementModel::get($this->url->getParameter(1)));
  6.         }
  7.         return $this->completeAdvertisementPost(
  8.             WebAdvertisementModel::getRevision(
  9.                 $this->url->getParameter(1),
Detail->getAdvertisementPost() in src/Web/Modules/Advertisement/Controller/Detail.php (line 112)
  1.         return $moduleSettings;
  2.     }
  3.     private function getData(): void
  4.     {
  5.         $this->blogPost $this->getAdvertisementPost();
  6.         $this->comments $this->getAdvertisementPostComments();
  7.         $this->settings $this->getModuleSettings();
  8.         $this->media WebAdvertisementModel::getAdvertisementMedia($this->blogPost['id']);
  9.         $this->logo WebAdvertisementModel::getAdvertisementMedia($this->blogPost['id'], 'logo');
  10.         $this->sales WebAdvertisementModel::getAdvertisementMedia($this->blogPost['id'], 'sales');
  1.     public function execute(): void
  2.     {
  3.         parent::execute();
  4.         $this->loadTemplate();
  5.         $this->getData();
  6.         $this->buildForm();
  7.         $this->handleForm();
  8.         $this->parse();
  9.     }
  10.     protected function setMeta(Meta $meta): void
Detail->execute() in src/Web/Core/Engine/Block/ExtraInterface.php (line 57)
  1.         if (!is_callable([$this->object'execute'])) {
  2.             throw new WebException('The action file should contain a callable method "execute".');
  3.         }
  4.         $this->object->execute();
  5.         $this->setOverwrite($this->object->getOverwrite());
  6.         if ($this->object->getTemplatePath() !== null) {
  7.             $this->setTemplatePath($this->object->getTemplatePath());
  8.         }
ExtraInterface->execute() in src/Web/Core/Engine/Page.php (line 345)
  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/Web/Core/Engine/Page.php (line 270)
  1.     {
  2.         $positions = [];
  3.         $mainVariables $this->template->getAssignedVariables();
  4.         foreach ($this->record['positions'] as $position => $blocks) {
  5.             foreach ($blocks as $i => $block) {
  6.                 $positions[$position][$i] = $this->parseBlock($block$mainVariables);
  7.             }
  8.             $this->template->assign('position' . \SpoonFilter::ucfirst($position), $positions[$position]);
  9.         }
  10.         $category '';
  11.         if (!empty($this->url->getParameter(1)))
Page->parsePositions() in src/Web/Core/Engine/Page.php (line 145)
  1.                 'cookieBarHide',
  2.                 !$this->get('icebird.settings')->get('Core''show_cookie_bar'false)
  3.                 || $this->getContainer()->get('icebird.cookie')->hasHiddenCookieBar()
  4.             );
  5.             $this->parsePositions();
  6.             $unusedPositions array_diff(
  7.                 $this->record['template_data']['names'],
  8.                 array_keys($this->record['positions'])
  9.             );
  10.             foreach ($unusedPositions as $position) {
Page->display() in src/Web/Core/Engine/Web.php (line 15)
  1. {
  2.     private $page;
  3.     public function display(): Response
  4.     {
  5.         return $this->page->display();
  6.     }
  7.     public function initialize(): void
  8.     {
  9.         new Url($this->getKernel());
Web->display() in app/IcebirdController.php (line 74)
  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();
IcebirdController->handleApplication(object(Web)) in app/IcebirdController.php (line 56)
  1.         defined('APPLICATION') || define('APPLICATION''Web');
  2.         $applicationClass $this->initializeWeb('Web');
  3.         $application = new $applicationClass($this->container->get('kernel'));
  4.         return $this->handleApplication($application);
  5.     }
  6.     public function webAjaxController(): Response
  7.     {
  8.         defined('APPLICATION') || define('APPLICATION''Web');
IcebirdController->webController() 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', (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) {
HttpKernel->handle(object(Request), 1, true) in app/Kernel.php (line 35)
  1.     }
  2.     public function handle(Request $request$type HttpKernelInterface::MASTER_REQUEST$catch true): Response
  3.     {
  4.         $this->boot();
  5.         return $this->getHttpKernel()->handle($request$type$catch);
  6.     }
  7.     public function boot(): void
  8.     {
  9.         if ($this->booted) {
  10.             return;
Kernel->handle(object(Request)) in /index.php (line 58)
  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: profile_id

  at src/Web/Modules/Advertisement/Model/Advertisement.php:45
  at Web\Modules\Advertisement\Model\Advertisement::get('oz-erciyes-halal')
     (src/Web/Modules/Advertisement/Controller/Detail.php:58)
  at Web\Modules\Advertisement\Controller\Detail->getAdvertisementPost()
     (src/Web/Modules/Advertisement/Controller/Detail.php:112)
  at Web\Modules\Advertisement\Controller\Detail->getData()
     (src/Web/Modules/Advertisement/Controller/Detail.php:35)
  at Web\Modules\Advertisement\Controller\Detail->execute()
     (src/Web/Core/Engine/Block/ExtraInterface.php:57)
  at Web\Core\Engine\Block\ExtraInterface->execute()
     (src/Web/Core/Engine/Page.php:345)
  at Web\Core\Engine\Page->parseBlock(array('extra' => object(ExtraInterface)), array())
     (src/Web/Core/Engine/Page.php:270)
  at Web\Core\Engine\Page->parsePositions()
     (src/Web/Core/Engine/Page.php:145)
  at Web\Core\Engine\Page->display()
     (src/Web/Core/Engine/Web.php:15)
  at Web\Core\Engine\Web->display()
     (app/IcebirdController.php:74)
  at IcebirdCMS\App\IcebirdController->handleApplication(object(Web))
     (app/IcebirdController.php:56)
  at IcebirdCMS\App\IcebirdController->webController()
     (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:35)
  at IcebirdCMS\App\Kernel->handle(object(Request))
     (index.php:58)