http://aep-beta.onpc.fr/fiche-organisme/OR032-3

Exceptions

Impossible to access an attribute ("photo") on a boolean variable ("").

Exception

Twig\Error\ RuntimeError

  1.                 {% set diapoPrincipal = diapo %}
  2.             {% endif %}
  3.         {% endfor %}
  4.     {% endif %}
  5.     {% set diapoPrincipal = diapoPrincipal == true ? diapoPrincipal : etablissement.diaporamas | first %}
  6.     {% set diapoPrincipalPhotos = etablissement.diapoPlus ? diapoPrincipal.photo : diapoPrincipal.photo | slice(0, etablissement.nombrePhotosMax) %}
  7. {% endif %}
  8. {% if etablissement.isClient and (diapoPrincipal != false or etablissement.imagesDiaporama is not empty) %}
  9. {# <!-- BS5 Carousel --> #}
  10. <div id="diapo" class="carousel slide carousel-dark" data-bs-ride="carousel">
  1.             // line 13
  2.             echo "    ";
  3.             $context["diapoPrincipal"] = (((=== twig_compare((isset($context["diapoPrincipal"]) || array_key_exists("diapoPrincipal"$context) ? $context["diapoPrincipal"] : (function () { throw new RuntimeError('Variable "diapoPrincipal" does not exist.'13$this->source); })()), true))) ? ((isset($context["diapoPrincipal"]) || array_key_exists("diapoPrincipal"$context) ? $context["diapoPrincipal"] : (function () { throw new RuntimeError('Variable "diapoPrincipal" does not exist.'13$this->source); })())) : (twig_first($this->envtwig_get_attribute($this->env$this->source, (isset($context["etablissement"]) || array_key_exists("etablissement"$context) ? $context["etablissement"] : (function () { throw new RuntimeError('Variable "etablissement" does not exist.'13$this->source); })()), "diaporamas", [], "any"falsefalsefalse13))));
  4.             // line 14
  5.             echo "    ";
  6.             $context["diapoPrincipalPhotos"] = ((twig_get_attribute($this->env$this->source, (isset($context["etablissement"]) || array_key_exists("etablissement"$context) ? $context["etablissement"] : (function () { throw new RuntimeError('Variable "etablissement" does not exist.'14$this->source); })()), "diapoPlus", [], "any"falsefalsefalse14)) ? (twig_get_attribute($this->env$this->source, (isset($context["diapoPrincipal"]) || array_key_exists("diapoPrincipal"$context) ? $context["diapoPrincipal"] : (function () { throw new RuntimeError('Variable "diapoPrincipal" does not exist.'14$this->source); })()), "photo", [], "any"falsefalsefalse14)) : (twig_slice($this->envtwig_get_attribute($this->env$this->source, (isset($context["diapoPrincipal"]) || array_key_exists("diapoPrincipal"$context) ? $context["diapoPrincipal"] : (function () { throw new RuntimeError('Variable "diapoPrincipal" does not exist.'14$this->source); })()), "photo", [], "any"falsefalsefalse14), 0twig_get_attribute($this->env$this->source, (isset($context["etablissement"]) || array_key_exists("etablissement"$context) ? $context["etablissement"] : (function () { throw new RuntimeError('Variable "etablissement" does not exist.'14$this->source); })()), "nombrePhotosMax", [], "any"falsefalsefalse14))));
  7.         }
  8.         // line 16
  9.         echo "
  10. ";
  11.         // line 17
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.                         <div class=\"col-lg-4\">
  2.                             ";
  3.         // line 286
  4.         echo "                            ";
  5.         $this->loadTemplate("fiche/_includes/diaporama.html.twig""fiche/index.html.twig"286)->display(twig_to_array(["etablissement" =>         // line 287
  6. (isset($context["etablissement"]) || array_key_exists("etablissement"$context) ? $context["etablissement"] : (function () { throw new RuntimeError('Variable "etablissement" does not exist.'287$this->source); })())]));
  7.         // line 289
  8.         echo "                        </div>
  9.                         <div class=\"col-lg-4 mt-4 mt-lg-0\">
  10.                             ";
in vendor/twig/twig/src/Template.php -> block_body (line 171)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1.         // line 129
  2.         echo "        ";
  3.         $this->loadTemplate("_includes/alerts.html.twig""base.html.twig"129)->display($context);
  4.         // line 130
  5.         echo "        ";
  6.         $this->displayBlock('body'$context$blocks);
  7.         // line 131
  8.         echo "        ";
  9.         $this->loadTemplate("_includes/footer.html.twig""base.html.twig"131)->display($context);
  10.         // line 132
  11.         echo "
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.         }
  2.         // line 220
  3.         $context["siteLdJson"] = twig_array_merge((isset($context["siteLdJson"]) || array_key_exists("siteLdJson"$context) ? $context["siteLdJson"] : (function () { throw new RuntimeError('Variable "siteLdJson" does not exist.'220$this->source); })()), [=> "etablissement"]);
  4.         // line 1
  5.         $this->parent $this->loadTemplate("base.html.twig""fiche/index.html.twig"1);
  6.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  7.         
  8.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  9.         
  10.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
in vendor/twig/twig/src/Template.php -> display (line 379)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.     public function render(array $context = []): string
  2.     {
  3.         // using func_get_args() allows to not expose the blocks argument
  4.         // as it should only be used by internal code
  5.         return $this->template->render($context, \func_get_args()[1] ?? []);
  6.     }
  7.     public function display(array $context = [])
  8.     {
  9.         // using func_get_args() allows to not expose the blocks argument
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = []): string
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.         if (!$this->container->has('twig')) {
  3.             throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      */
  1.     /**
  2.      * Renders a view.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         if (null === $response) {
  8.             $response = new Response();
  9.         }
AbstractController->render() in src/Controller/FicheController.php (line 472)
  1.             'internatLie'   => $internatLie,
  2.             'textePresentation' => $textePresentation,
  3.             'form' => $form->createView(),
  4.             'type_etab' => $typeEtab,
  5.             'noindex' => $etablissement->getTypeClient() == "organisme" true false,
  6.             'diEnvoyee' => $diEnvoyee
  7.         ]);
  8.     }
  9.     /**
  10.      * @Route(
  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.     }
  1.         if (!IpUtils::checkIp('127.0.0.1'$trustedProxies)) {
  2.             Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3.         }
  4.         try {
  5.             return $kernel->handle($request$type$catch);
  6.         } finally {
  7.             // restore global state
  8.             Request::setTrustedProxies($trustedProxies$trustedHeaderSet);
  9.         }
  10.     }
  1.         if ($this->surrogate) {
  2.             $this->surrogate->addSurrogateCapability($request);
  3.         }
  4.         // always a "master" request (as the real master request can be in cache)
  5.         $response SubRequestHandler::handle($this->kernel$requestHttpKernelInterface::MAIN_REQUEST$catch);
  6.         /*
  7.          * Support stale-if-error given on Responses or as a config option.
  8.          * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9.          * Cache-Control directives) that
  1.     protected function forward(Request $requestbool $catch falseResponse $entry null)
  2.     {
  3.         $this->getKernel()->boot();
  4.         $this->getKernel()->getContainer()->set('cache'$this);
  5.         return parent::forward($request$catch$entry);
  6.     }
  7.     /**
  8.      * Returns an array of options to customize the Cache configuration.
  9.      *
  1.         // avoid that the backend sends no content
  2.         $subRequest->headers->remove('If-Modified-Since');
  3.         $subRequest->headers->remove('If-None-Match');
  4.         $response $this->forward($subRequest$catch);
  5.         if ($response->isCacheable()) {
  6.             $this->store($request$response);
  7.         }
  1.         }
  2.         if (null === $entry) {
  3.             $this->record($request'miss');
  4.             return $this->fetch($request$catch);
  5.         }
  6.         if (!$this->isFreshEnough($request$entry)) {
  7.             $this->record($request'stale');
  1.                 reload the cache by fetching a fresh response and caching it (if possible).
  2.             */
  3.             $this->record($request'reload');
  4.             $response $this->fetch($request$catch);
  5.         } else {
  6.             $response $this->lookup($request$catch);
  7.         }
  8.         $this->restoreResponseBody($request$response);
  9.         if (HttpKernelInterface::MAIN_REQUEST === $type) {
  1.     {
  2.         if (!$this->booted) {
  3.             $container $this->container ?? $this->preBoot();
  4.             if ($container->has('http_cache')) {
  5.                 return $container->get('http_cache')->handle($request$type$catch);
  6.             }
  7.         }
  8.         $this->boot();
  9.         ++$this->requestStackSize;
Kernel->handle() in public/index.php (line 22)
  1.     Debug::enable();
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

RuntimeError
Twig\Error\RuntimeError:
Impossible to access an attribute ("photo") on a boolean variable ("").

  at templates/fiche/_includes/diaporama.html.twig:14
  at twig_get_attribute()
     (var/cache/dev/twig/16/161b12dcdebb237e47577aa48c51243a64d874ddbf3600b5b59ece50fdd5ddce.php:80)
  at __TwigTemplate_7223d5e6bd599aca54d8ff6d4a46e61c6abcecf164fbbddf0cdb3afb42583e41->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/dev/twig/67/6747ca99dedc355e7b65d01618dde90d594025952b60831f772e180754fde8b2.php:570)
  at __TwigTemplate_adfde8a2c181be34224da679610d8a5f379ebd5bbe29787c808990cc9c7f6724->block_body()
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock()
     (var/cache/dev/twig/ce/ce484f4ef477a0f74f775d46919493c7b89f946d005cc4126fe2b34acafe91cb.php:343)
  at __TwigTemplate_c9a8f26e4c67e4400f6f1d1a93b2acd78733561fe27d3fd35277854386de8893->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/dev/twig/67/6747ca99dedc355e7b65d01618dde90d594025952b60831f772e180754fde8b2.php:74)
  at __TwigTemplate_adfde8a2c181be34224da679610d8a5f379ebd5bbe29787c808990cc9c7f6724->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:280)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:258)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:266)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/FicheController.php:472)
  at App\Controller\FicheController->index()
     (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()
     (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86)
  at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:479)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
     (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:73)
  at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:452)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
     (vendor/symfony/http-kernel/HttpCache/HttpCache.php:224)
  at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
     (vendor/symfony/http-kernel/Kernel.php:193)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:22)