logo
Variable "image" does not exist in "article/base.html.twig" at line 31. (500 Internal Server Error)

Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

Variable "image" does not exist in article/base.html.twig at line 31.

Exception

Twig\Error\ RuntimeError

Show exception properties
Twig\Error\RuntimeError {#1840
  -lineno: 31
  -rawMessage: "Variable "image" does not exist."
  -source: Twig\Source {#1349
    -code: """
      <!--CONTENT-->\n
      <section id="content"\n
               class="pt-42px pb-36px pl-ls-42px overflow-ls-hidden overflow-md-hidden pl-ls-lg-0 pt-xl-66px pb-lg-66px mw-1440px mx-xl-auto w-100">\n
      \n
          <!--ARTICLE-->\n
          <div class="bg-white pt-24px px-24px position-relative d-md-flex px-xl-48px mx-xl-n30px justify-content-md-center flex-column">\n
      \n
              <!--back | TODO JF: lien dynamique vers la page précédente-->\n
              <a href="{% block url_back %}/{% endblock %}"\n
                 class="button lvl3 align-self-ls-md-start align-self-md-start position-relative right-0 right-hover-12px fs-short-2"><i\n
                          class="fas fa-angle-left pr-8px d-ls-md-inline pr-md-12px fs-short-2 d-md-inline"></i>\n
                  {% block name_back %}Retour à {% endblock %}</a>\n
      \n
              <!--title-->\n
              <h2 class="text-ls-md-left pt-ls-md-8px text-md-left pt-md-8px">\n
                  {% block title %}\n
                      {{ title|puriferHtml|raw }}\n
                  {% endblock %}\n
              </h2>\n
      \n
              <!--category-->\n
              <span class="{{ color }} ff-semibold pt-12px d-block fs-short-2">\n
                  {% block category %}{{ blogName }}{% endblock %}\n
              </span>\n
      \n
              <!--article-->\n
              <div class="pt-48px d-lg-flex mx-n15px">\n
                  <div class="d-flex flex-column align-items-center mx-md-n15px flex-md-wrap flex-md-row align-items-md-start flex-lg-column col-lg-8 mx-lg-0 flex-lg-nowrap">\n
                      <!--img-->\n
                      {% block image %}\n
                          {% if image and image is not empty %}\n
                              <div class="bg-img w-100 h-220px position-relative h-lg-330px">\n
                                  <a href="{{ image }}" class="d-block h-220px h-lg-330px img-lightGallery">\n
                                      <i style="background-position:center; background-image: url('{{ image }}'); background-repeat: no-repeat; background-size: cover;"\n
                                         class="position-absolute top-0 bottom-0 left-0 right-0 md-left-15px md-right-15px lg-left-0 lg-right-0"></i>\n
                                  </a>\n
                              </div>\n
                          {% endif %}\n
                      {% endblock %}\n
      \n
                      <!--OBJECT | TAGS-->\n
                      <div class="overflow-hidden2 w-100 pt-24px col-md-12 px-0 px-md-15px d-lg-none">\n
                          <ul class="object-tags">\n
                              {% include 'article/_tags.html.twig' %}\n
                          </ul>\n
                      </div>\n
      \n
                      <!--OBJECT | TEXT-DYN | TODO JF : brancher la possibilité d'ouvrir/réduire le content avec un ellipsis + condition sur l'extend-->\n
                      <div class="object-text-dyn col-md-8 px-0 px-md-15px col-lg-12 px-lg-0">\n
                          <input type="checkbox" id="text-dyn"/>\n
                          <div for="text-dyn">\n
                              <span class="more d-none">Lire plus</span>\n
                              <span class="less d-none">Réduire</span>\n
                          </div>\n
                          <div for="text-dyn">\n
                              {% include 'article/_readspeaker.html.twig' %}\n
                              <div id="reading" class="m-3">\n
                                  <span>\n
                              {% block content %}\n
                                  <p></p>\n
                              {% endblock %}\n
                                  </span>\n
                              </div>\n
                          </div>\n
                      </div>\n
      \n
                      <!--OBJECT | SHARE-->\n
                      <div class="pt-24px w-100 col-md-4 px-0 px-md-15px d-lg-none">\n
                          <h4 class="text-dark-primary fs-basic text-right text-lg-left">Partagez l'article via</h4>\n
                          <div class="pt-12px pt-md-16px object-share">\n
                              {% include 'article/_share_links.html.twig' %}\n
                          </div>\n
                      </div>\n
      \n
                      <!--previous/next\n
                      <div class="pt-24px d-flex w-100 col-md-8 px-0 px-md-15px col-lg-12 px-lg-0">\n
                          <div class="col-6 p-0 d-flex">\n
                              <a href="#"\n
                                 class="button lvl3 align-self-ls-md-center align-self-md-center position-relative left-0 left-hover-n12px d-flex justify-content-center fs-short-2"><i\n
                                          class="fas fa-angle-left d-ls-md-inline pr-8px pr-md-12px fs-short-1 d-md-inline"></i>Article\n
                                  précédent</a>\n
                          </div>\n
                          <div class="col-6 p-0 d-flex justify-content-end">\n
                              <a href="#"\n
                                 class="button lvl3 align-self-ls-md-center align-self-md-center position-relative left-0 left-hover-12px d-flex justify-content-center fs-short-2">Article\n
                                  suivant<i\n
                                          class="fas fa-angle-right d-ls-md-inline pl-8px pl-md-12px fs-short-1 d-md-inline"></i></a>\n
                          </div>\n
                      </div>-->\n
      \n
                      <!--OBJECT | RECOM-->\n
                      <div class="pt-24px w-100 col-md-8 px-0 px-md-15px d-lg-none">\n
                          <h4 class="text-dark-primary ff-semibold fs-basic">Consultez aussi</h4>\n
                          <div class="pt-12px object-recom">\n
                              {% include 'article/_recommandations.html.twig' %}\n
                          </div>\n
                      </div>\n
                  </div>\n
      \n
                  <div class="d-none d-lg-flex col-4 flex-column h-330px justify-content-between">\n
      \n
                      <!--OBJECT | SHARE-->\n
                      <div class="w-100">\n
                          <h4 class="text-dark-primary fs-basic text-right text-lg-left">Partagez l'article via</h4>\n
                          <div class="pt-12px pt-md-16px object-share">\n
                              {% include 'article/_share_links.html.twig' %}\n
                          </div>\n
                      </div>\n
      \n
                      <!--OBJECT | TAGS-->\n
                      <div class="overflow-hidden2 w-100 pt-24px">\n
                          <ul class="object-tags">\n
                              {% include 'article/_tags.html.twig' %}\n
                          </ul>\n
                      </div>\n
      \n
                      <!--OBJECT | RECOM-->\n
                      <div class="pt-24px w-100">\n
                          <h4 class="text-dark-primary ff-semibold fs-basic">Consultez aussi</h4>\n
                          <div class="pt-22px object-recom">\n
                              {% include 'article/_recommandations.html.twig' %}\n
                          </div>\n
                      </div>\n
                  </div>\n
              </div>\n
          </div>\n
      </section>\n
      \n
      {% block scripts %}\n
      \n
      {% endblock %}\n
      """
    -name: "article/base.html.twig"
    -path: "/var/www/marchebe/wp-content/themes/marchebe/templates/article/base.html.twig"
  }
  -phpFile: "/var/www/marchebe/var/cache/aa/aa2e7e1e55680305976d2c1c67e5bc10.php"
  -phpLine: 269
}
  1. <!--article-->
  2. <div class="pt-48px d-lg-flex mx-n15px">
  3. <div class="d-flex flex-column align-items-center mx-md-n15px flex-md-wrap flex-md-row align-items-md-start flex-lg-column col-lg-8 mx-lg-0 flex-lg-nowrap">
  4. <!--img-->
  5. {% block image %}
  6. {% if image and image is not empty %}
  7. <div class="bg-img w-100 h-220px position-relative h-lg-330px">
  8. <a href="{{ image }}" class="d-block h-220px h-lg-330px img-lightGallery">
  9. <i style="background-position:center; background-image: url('{{ image }}'); background-repeat: no-repeat; background-size: cover;"
  10. class="position-absolute top-0 bottom-0 left-0 right-0 md-left-15px md-right-15px lg-left-0 lg-right-0"></i>
  11. </a>
  1. public function block_image(array $context, array $blocks = []): iterable
  2. {
  3. $macros = $this->macros;
  4. // line 31
  5. yield " ";
  6. if (((isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 31, $this->source); })()) && !Twig\Extension\CoreExtension::testEmpty((isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 31, $this->source); })())))) {
  7. // line 32
  8. yield " <div class=\"bg-img w-100 h-220px position-relative h-lg-330px\">
  9. <a href=\"";
  10. // line 33
  11. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["image"]) || array_key_exists("image", $context) ? $context["image"] : (function () { throw new RuntimeError('Variable "image" does not exist.', 33, $this->source); })()), "html", null, true);
  1. throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2. }
  3. if (null !== $template) {
  4. try {
  5. yield from $template->$block($context, $blocks);
  6. } catch (Error $e) {
  7. if (!$e->getSourceContext()) {
  8. $e->setSourceContext($template->getSourceContext());
  9. }
  1. <div class=\"pt-48px d-lg-flex mx-n15px\">
  2. <div class=\"d-flex flex-column align-items-center mx-md-n15px flex-md-wrap flex-md-row align-items-md-start flex-lg-column col-lg-8 mx-lg-0 flex-lg-nowrap\">
  3. <!--img-->
  4. ";
  5. // line 30
  6. yield from $this->unwrap()->yieldBlock('image', $context, $blocks);
  7. // line 40
  8. yield "
  9. <!--OBJECT | TAGS-->
  10. <div class=\"overflow-hidden2 w-100 pt-24px col-md-12 px-0 px-md-15px d-lg-none\">
  11. <ul class=\"object-tags\">
  1. {
  2. $context += $this->env->getGlobals();
  3. $blocks = array_merge($this->blocks, $blocks);
  4. try {
  5. yield from $this->doDisplay($context, $blocks);
  6. } catch (Error $e) {
  7. if (!$e->getSourceContext()) {
  8. $e->setSourceContext($this->getSourceContext());
  9. }
  1. protected function doDisplay(array $context, array $blocks = []): iterable
  2. {
  3. $macros = $this->macros;
  4. $this->parent = $this->load("article/base.html.twig", 1);
  5. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  6. }
  7. // line 3
  8. /**
  9. * @return iterable<null|scalar|\Stringable>
  1. {
  2. $context += $this->env->getGlobals();
  3. $blocks = array_merge($this->blocks, $blocks);
  4. try {
  5. yield from $this->doDisplay($context, $blocks);
  6. } catch (Error $e) {
  7. if (!$e->getSourceContext()) {
  8. $e->setSourceContext($this->getSourceContext());
  9. }
  1. protected function doDisplay(array $context, array $blocks = []): iterable
  2. {
  3. $macros = $this->macros;
  4. $this->parent = $this->load("article/show.html.twig", 1);
  5. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  6. }
  7. // line 3
  8. /**
  9. * @return iterable<null|scalar|\Stringable>
  1. {
  2. $context += $this->env->getGlobals();
  3. $blocks = array_merge($this->blocks, $blocks);
  4. try {
  5. yield from $this->doDisplay($context, $blocks);
  6. } catch (Error $e) {
  7. if (!$e->getSourceContext()) {
  8. $e->setSourceContext($this->getSourceContext());
  9. }
  1. return $this->blocks;
  2. }
  3. public function display(array $context, array $blocks = []): void
  4. {
  5. foreach ($this->yield($context, $blocks) as $data) {
  6. echo $data;
  7. }
  8. }
  9. public function render(array $context): string
  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. yield from $this->template->yieldBlock($name, $context);
  2. }
  3. public function render(array $context = []): string
  4. {
  5. return $this->template->render($context);
  6. }
  7. /**
  8. * @return void
  9. */
  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. if (!$fiche) {
  2. $object = new \stdClass();
  3. $object->slug = $path;
  4. $route = RouterBottin::getUrlCategoryBottin($object);
  5. return $twig->render(
  6. 'fiche/not_found.html.twig',
  7. [
  8. 'title' => 'Fiche non trouvée',
  9. 'tags' => [],
  10. 'content' => '',
in /var/www/marchebe/vendor/symfony/cache/LockRegistry.php AcMarche\Theme\{closure} (line 111)
  1. if ($locked || !$wouldBlock) {
  2. $logger?->info(sprintf('Lock %s, now computing item "{key}"', $locked ? 'acquired' : 'not supported'), ['key' => $item->getKey()]);
  3. self::$lockedFiles[$key] = true;
  4. $value = $callback($item, $save);
  5. if ($save) {
  6. if ($setMetadata) {
  7. $setMetadata($item);
  8. }
  1. if (!isset($this->callbackWrapper)) {
  2. $this->setCallbackWrapper($this->setCallbackWrapper(null));
  3. }
  4. try {
  5. $value = ($this->callbackWrapper)($callback, $item, $save, $pool, function (CacheItem $item) use ($setMetadata, $startTime, &$metadata) {
  6. $setMetadata($item, $startTime, $metadata);
  7. }, $this->logger ?? null);
  8. $setMetadata($item, $startTime, $metadata);
  9. return $value;
in /var/www/marchebe/vendor/symfony/cache-contracts/CacheTrait.php -> Symfony\Component\Cache\Traits\{closure} (line 64)
  1. }
  2. }
  3. if ($recompute) {
  4. $save = true;
  5. $item->set($callback($item, $save));
  6. if ($save) {
  7. $pool->save($item);
  8. }
  9. }
  1. CacheItem::class
  2. );
  3. $this->callbackWrapper ??= LockRegistry::compute(...);
  4. return $this->contractsGet($pool, $key, function (CacheItem $item, bool &$save) use ($pool, $callback, $setMetadata, &$metadata, $key) {
  5. // don't wrap nor save recursive calls
  6. if (isset($this->computing[$key])) {
  7. $value = $callback($item, $save);
  8. $save = false;
  1. */
  2. trait CacheTrait
  3. {
  4. public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
  5. {
  6. return $this->doGet($this, $key, $callback, $beta, $metadata);
  7. }
  8. public function delete(string $key): bool
  9. {
  10. return $this->deleteItem($key);
  1. $slugFiche = $wp_query->get(RouterBottin::PARAM_BOTTIN_FICHE, null);
  2. $code = 'bottin-fiche-'.$blodId.'-'.$slugFiche;
  3. get_header();
  4. echo $cache->get(
  5. $code,
  6. function () use ($slugFiche, $blodId, $wp_query) {
  7. $twig = Twig::LoadTwig();
  8. $bottinRepository = new BottinRepository();
include('/var/www/marchebe/wp-content/themes/marchebe/single-bottin_fiche.php') in /var/www/marchebe/wp-includes/template-loader.php (line 106)
  1. *
  2. * @param string $template The path of the template to include.
  3. */
  4. $template = apply_filters( 'template_include', $template );
  5. if ( $template ) {
  6. include $template;
  7. } elseif ( current_user_can( 'switch_themes' ) ) {
  8. $theme = wp_get_theme();
  9. if ( $theme->errors() ) {
  10. wp_die( $theme->errors() );
  11. }
require_once('/var/www/marchebe/wp-includes/template-loader.php') in /var/www/marchebe/wp-blog-header.php (line 19)
  1. // Set up the WordPress query.
  2. wp();
  3. // Load the theme template.
  4. require_once ABSPATH . WPINC . '/template-loader.php';
  5. }
require('/var/www/marchebe/wp-blog-header.php') in /var/www/marchebe/index.php (line 17)
  1. * @var bool
  2. */
  3. define( 'WP_USE_THEMES', true );
  4. /** Loads the WordPress Environment and Template */
  5. require __DIR__ . '/wp-blog-header.php';

Stack Trace

RuntimeError
Twig\Error\RuntimeError:
Variable "image" does not exist in "article/base.html.twig" at line 31.

  at /var/www/marchebe/wp-content/themes/marchebe/templates/article/base.html.twig:31
  at __TwigTemplate_9d09a478bb655943967ee0877181193e->{closure}()
     (/var/www/marchebe/var/cache/aa/aa2e7e1e55680305976d2c1c67e5bc10.php:269)
  at __TwigTemplate_9d09a478bb655943967ee0877181193e->block_image()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:446)
  at Twig\Template->yieldBlock()
     (/var/www/marchebe/var/cache/aa/aa2e7e1e55680305976d2c1c67e5bc10.php:93)
  at __TwigTemplate_9d09a478bb655943967ee0877181193e->doDisplay()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:402)
  at Twig\Template->yield()
     (/var/www/marchebe/var/cache/57/576359d7e8b2e9db53383fb774dbcf55.php:50)
  at __TwigTemplate_fc549d5de535450584232f835c75cf0c->doDisplay()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:402)
  at Twig\Template->yield()
     (/var/www/marchebe/var/cache/e8/e8818a007906568bc16c8e1dbd46dfe3.php:48)
  at __TwigTemplate_5f26339d565b44dfe2d9d97173104720->doDisplay()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:402)
  at Twig\Template->yield()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:358)
  at Twig\Template->display()
     (/var/www/marchebe/vendor/twig/twig/src/Template.php:373)
  at Twig\Template->render()
     (/var/www/marchebe/vendor/twig/twig/src/TemplateWrapper.php:51)
  at Twig\TemplateWrapper->render()
     (/var/www/marchebe/vendor/twig/twig/src/Environment.php:333)
  at Twig\Environment->render()
     (/var/www/marchebe/wp-content/themes/marchebe/single-bottin_fiche.php:48)
  at AcMarche\Theme\{closure}()
     (/var/www/marchebe/vendor/symfony/cache/LockRegistry.php:111)
  at Symfony\Component\Cache\LockRegistry::compute()
     (/var/www/marchebe/vendor/symfony/cache/Traits/ContractsTrait.php:102)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->Symfony\Component\Cache\Traits\{closure}()
     (/var/www/marchebe/vendor/symfony/cache-contracts/CacheTrait.php:64)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->contractsGet()
     (/var/www/marchebe/vendor/symfony/cache/Traits/ContractsTrait.php:85)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->doGet()
     (/var/www/marchebe/vendor/symfony/cache-contracts/CacheTrait.php:30)
  at Symfony\Component\Cache\Adapter\AbstractAdapter->get()
     (/var/www/marchebe/wp-content/themes/marchebe/single-bottin_fiche.php:23)
  at include('/var/www/marchebe/wp-content/themes/marchebe/single-bottin_fiche.php')
     (/var/www/marchebe/wp-includes/template-loader.php:106)
  at require_once('/var/www/marchebe/wp-includes/template-loader.php')
     (/var/www/marchebe/wp-blog-header.php:19)
  at require('/var/www/marchebe/wp-blog-header.php')
     (/var/www/marchebe/index.php:17)