Symfony Exception

Error

HTTP 500 Internal Server Error

Call to a member function getOptions() on null

Exception

Error

in src/Shop/Shop.php (line 585)
  1.     */
  2.     public function getProductOptionsHtml ($product)
  3.     {
  4.       $html             "";
  5.       $product_options  = [];
  6.       if ( $product->getOptions() )
  7.           $product_options  $product->getOptions()->getBrickGetters();
  8.           
  9.       if ( count($product_options) )
  10.       {
  11.           foreach ($product_options as $optionGetter)
Shop->getProductOptionsHtml() in src/Controller/ShopController.php (line 300)
  1.             'cart'                => $_cart,
  2.             'userCartItems'       => $shopHelper ->countCartItems$_cart ),
  3.             'cartHasDigitals'     => $shopHelper ->cartDigitalProducts$_cart ),
  4.             'cartItemsTypes'      => $shopHelper ->getCartItemsTypes$_cart ),
  5.             'product'             => $product,
  6.             'productOptions'      => $_shop ->getProductOptionsHtml$product ),
  7.             'shopMenu'            => $shopHelper ->getCategoriesMenu$shop->getShop_category_root(), WEBSITE_SHOP_FRONTEND_CATEGORIES_PATH$cId$_locale ),
  8.             'shopBreadcrumbs'     => $shopHelper ->getCategoriesBreadcrumbs $shop$_locale ),
  9.             'manufacturersList'   => $brands,
  10.             'metaTitle'           => ( WEBSITE_SHOP_FRONTEND_NAME ' | ' $product->getName() ),
  11.             'metaDescription'     => trim$product->getMeta_description() )
in vendor/symfony/http-kernel/HttpKernel.php -> productAction (line 163)
  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 public/index.php (line 36)
  1. $kernel \Pimcore\Bootstrap::kernel();
  2. // reset current request - will be read from request stack from now on
  3. Tool::setCurrentRequest(null);
  4. $response $kernel->handle($request);
  5. $response->send();
  6. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

Error
Error:
Call to a member function getOptions() on null

  at src/Shop/Shop.php:585
  at App\Shop\Shop->getProductOptionsHtml()
     (src/Controller/ShopController.php:300)
  at App\Controller\ShopController->productAction()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:36)