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 }
<!--article-->
<div class="pt-48px d-lg-flex mx-n15px">
<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">
<!--img-->
{% block image %}
{% if image and image is not empty %}
<div class="bg-img w-100 h-220px position-relative h-lg-330px">
<a href="{{ image }}" class="d-block h-220px h-lg-330px img-lightGallery">
<i style="background-position:center; background-image: url('{{ image }}'); background-repeat: no-repeat; background-size: cover;"
class="position-absolute top-0 bottom-0 left-0 right-0 md-left-15px md-right-15px lg-left-0 lg-right-0"></i>
</a>
public function block_image(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
// line 31
yield " ";
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); })())))) {
// line 32
yield " <div class=\"bg-img w-100 h-220px position-relative h-lg-330px\">
<a href=\"";
// line 33
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);
throw new \LogicException('A block must be a method on a \Twig\Template instance.');
}
if (null !== $template) {
try {
yield from $template->$block($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($template->getSourceContext());
}
<div class=\"pt-48px d-lg-flex mx-n15px\">
<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\">
<!--img-->
";
// line 30
yield from $this->unwrap()->yieldBlock('image', $context, $blocks);
// line 40
yield "
<!--OBJECT | TAGS-->
<div class=\"overflow-hidden2 w-100 pt-24px col-md-12 px-0 px-md-15px d-lg-none\">
<ul class=\"object-tags\">
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$this->parent = $this->load("article/base.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$this->parent = $this->load("article/show.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
return $this->blocks;
}
public function display(array $context, array $blocks = []): void
{
foreach ($this->yield($context, $blocks) as $data) {
echo $data;
}
}
public function render(array $context): string
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
yield from $this->template->yieldBlock($name, $context);
}
public function render(array $context = []): string
{
return $this->template->render($context);
}
/**
* @return void
*/
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = []): string
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
if (!$fiche) {
$object = new \stdClass();
$object->slug = $path;
$route = RouterBottin::getUrlCategoryBottin($object);
return $twig->render(
'fiche/not_found.html.twig',
[
'title' => 'Fiche non trouvée',
'tags' => [],
'content' => '',
if ($locked || !$wouldBlock) {
$logger?->info(sprintf('Lock %s, now computing item "{key}"', $locked ? 'acquired' : 'not supported'), ['key' => $item->getKey()]);
self::$lockedFiles[$key] = true;
$value = $callback($item, $save);
if ($save) {
if ($setMetadata) {
$setMetadata($item);
}
if (!isset($this->callbackWrapper)) {
$this->setCallbackWrapper($this->setCallbackWrapper(null));
}
try {
$value = ($this->callbackWrapper)($callback, $item, $save, $pool, function (CacheItem $item) use ($setMetadata, $startTime, &$metadata) {
$setMetadata($item, $startTime, $metadata);
}, $this->logger ?? null);
$setMetadata($item, $startTime, $metadata);
return $value;
}
}
if ($recompute) {
$save = true;
$item->set($callback($item, $save));
if ($save) {
$pool->save($item);
}
}
CacheItem::class
);
$this->callbackWrapper ??= LockRegistry::compute(...);
return $this->contractsGet($pool, $key, function (CacheItem $item, bool &$save) use ($pool, $callback, $setMetadata, &$metadata, $key) {
// don't wrap nor save recursive calls
if (isset($this->computing[$key])) {
$value = $callback($item, $save);
$save = false;
*/
trait CacheTrait
{
public function get(string $key, callable $callback, ?float $beta = null, ?array &$metadata = null): mixed
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
public function delete(string $key): bool
{
return $this->deleteItem($key);
$slugFiche = $wp_query->get(RouterBottin::PARAM_BOTTIN_FICHE, null);
$code = 'bottin-fiche-'.$blodId.'-'.$slugFiche;
get_header();
echo $cache->get(
$code,
function () use ($slugFiche, $blodId, $wp_query) {
$twig = Twig::LoadTwig();
$bottinRepository = new BottinRepository();
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
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) |