Symfony Exception

ErrorException

HTTP 500 Internal Server Error

Warning: Invalid argument supplied for foreach()

Exception

ErrorException

  1.         $this->_buildProduct($contents$products);
  2.     }
  3.     private function _buildProduct($contents$products) {
  4.         if ($products->getCount() > 0) {
  5.             foreach ($products->getCollection() as $product) {
  6.                 if (== $product->getType()->getId()) {
  7.                     $product_display $product->display('card.html.twig');
  8.                     $attributes $product->getAvailableProductVariations();
  9.                     $extra_content '';
  10.                     if (count($attributes) > 0) {
Controller->_buildProduct() in lib/ludri_commerce_package/src/Catalog/Controller.php (line 237)
  1.         $this->getContainer()['catalog.args'] = function () use ($args) { return $args; };
  2.         $this->getContainer()['catalog.request'] = function () use ($request) { return $request; };
  3.         $this->getContainer()['catalog.taxon'] = function () use ($taxon) { return $taxon; };
  4.         $this->getContainer()['catalog.brand'] = function () use ($brand) { return $brand; };
  5.         $this->getContainer()['catalog.sales'] = 0;
  6.         $this->_buildProduct($contents$products);
  7.     }
  8.     public function searchAction(Request $request) {
  9.         $this->body->setTemplate('catalog/listing.html.twig');
  10.         $this->setVar('body_classes''catalog-page search-page');
Controller->indexAction() in lib/ludri_framework_package/src/Core/Router.php (line 274)
  1.             $parameters $reflection->getParameters();
  2.             // @todo add compare to RequestInterface
  3.             if (=== $reflection->getNumberOfParameters()
  4.                 && $parameters[0]->getClass()
  5.                 && 'Ludri\Framework\Http\Request' == $parameters[0]->getClass()->getName()) {
  6.                 $response $this->controller->{$this->action}($this->getRequest($this->vars));
  7.             } else if (=== $reflection->getNumberOfParameters()) {
  8.                 $response $this->controller->{$this->action}();
  9.             } else if (=== $reflection->getNumberOfParameters()
  10.                 && !array_key_exists($parameters[0]->getName(), $this->vars)) {
  11.                 $response $this->controller->{$this->action}($this->vars);
  1.         $this->_ludri->getContainer()['router'] = function($container) {
  2.             return $this->router;
  3.         };
  4.         $event = new Event('app/start'$this);
  5.         $this->_ludri->trigger($event);
  6.         $response $this->router->dispatch();
  7.         $event = new Event('app/prerender'$this);
  8.         $this->_ludri->trigger($event);
  9.         if (false === $response) {
  10.             if ('' == Ludri::url()->pathkey) {
  11.                 $this->router->dispatch('page');
  1.         }
  2.     }
  3.     public function execute() {
  4.         if ($this->isInstalled()) {
  5.             $response $this->start();
  6.         } else if ($this->isInstaller()) {
  7.             $response $this->install();
  8.         }
  9.         if ($response instanceof \Ludri\Framework\Http\Response) {
  10.             $args = [
  1.     public function execCommand(Command\Arguments $arguments) {
  2.         $this->_container['console']->exec($arguments);
  3.     }
  4.     public function generate($contents '') {
  5.         return $this->_container['app']->execute($contents '');
  6.     }
  7.     /**
  8.      * Legacy statics methods
  9.      */
Ludri->generate() in src/Bridge/LudriBridge.php (line 27)
  1.         // Figure out how to map to the needed script file
  2.         // from the existing application and possibly (re-)set
  3.         // some env vars.
  4.         return $ludri->generate();
  5.     }
  6. }
LudriBridge::toLudri() in web/index.php (line 50)
  1. if ($_SERVER['REMOTE_ADDR'] == '88.173.128.90') {
  2.     //echo $_ENV['APP_DEBUG'];
  3.     error_reporting(0);
  4. ini_set('display_errors'0);
  5. }
  6. $ludriResponse LudriBridge::toLudri($ludri$request$response__DIR__);
  7. if (!$ludriResponse instanceof LudriResponse) {
  8.     $response->send();
  9.     $kernel->terminate($request$response);
  10. } else {
  11.     echo $ludriResponse;

Logs

No log messages

Stack Trace

ErrorException
ErrorException:
Warning: Invalid argument supplied for foreach()

  at lib/ludri_commerce_package/src/Catalog/Controller.php:514
  at Ludri\Commerce\Catalog\Controller->_buildProduct()
     (lib/ludri_commerce_package/src/Catalog/Controller.php:237)
  at Ludri\Commerce\Catalog\Controller->indexAction()
     (lib/ludri_framework_package/src/Core/Router.php:274)
  at Ludri\Framework\Core\Router->dispatch()
     (lib/ludri_framework_package/src/Core/Ludri/App.php:93)
  at Ludri\Framework\Core\Ludri\App->start()
     (lib/ludri_framework_package/src/Core/Ludri/App.php:237)
  at Ludri\Framework\Core\Ludri\App->execute()
     (lib/ludri_framework_package/src/Core/Ludri.php:302)
  at Ludri\Framework\Core\Ludri->generate()
     (src/Bridge/LudriBridge.php:27)
  at App\Bridge\LudriBridge::toLudri()
     (web/index.php:50)