Twig\Error\RuntimeError {#1867 -lineno: 9 -rawMessage: "Neither the property "name" nor one of the methods "name()", "getname()"/"isname()"/"hasname()" or "__call()" exist and have public access in class "stdClass"." -source: Twig\Source {#1805 -code: """ {% if relations | length > 0 %}\n {% set relation = random(relations) %}\n <a href="{{ relation.url }}" class="bg-img">\n <i {% if relation.image is defined %}style="background-image: url('{{ relation.image }}');"{% endif %}\n class="bg-img-news-1">\n <b class="bg-img-bgcolor-hover-primary-55"></b>\n </i>\n <div class="col">\n <h5 class="text-hover-primary">{{ relation.name|puriferHtml|raw }}</h5>\n <span class="{{ color }}">{{ blogName }}</span>\n </div>\n </a>\n {% else %}\n <a href="#" class="bg-img">\n <i\n class="bg-img-news-1">\n <b class="bg-img-bgcolor-hover-primary-55"></b>\n </i>\n <div class="col">\n <h5 class="text-hover-primary">Aucune</h5>\n <span class="{{ color }}">{{ blogName }}</span>\n </div>\n </a>\n {% endif %}\n <!--\n <a href="#" class="bg-img">\n <i class="bg-img-news-1">\n <b class="bg-img-bgcolor-hover-primary-55"></b>\n </i>\n <div class="col">\n <h5 class="text-hover-primary">Écoles de devoirs : un petit déjeuner avec les volontaires</h5>\n <span class="color-cat-cit">Citoyen</span>\n </div>\n </a>\n -->\n """ -name: "article/_recommandations.html.twig" -path: "/var/www/marchebe/wp-content/themes/marchebe/templates/article/_recommandations.html.twig" } -phpFile: "/var/www/marchebe/vendor/twig/twig/src/Extension/CoreExtension.php" -phpLine: 1883 }
<i {% if relation.image is defined %}style="background-image: url('{{ relation.image }}');"{% endif %}
class="bg-img-news-1">
<b class="bg-img-bgcolor-hover-primary-55"></b>
</i>
<div class="col">
<h5 class="text-hover-primary">{{ relation.name|puriferHtml|raw }}</h5>
<span class="{{ color }}">{{ blogName }}</span>
</div>
</a>
{% else %}
<a href="#" class="bg-img">
<b class=\"bg-img-bgcolor-hover-primary-55\"></b>
</i>
<div class=\"col\">
<h5 class=\"text-hover-primary\">";
// line 9
yield $this->env->getFilter('puriferHtml')->getCallable()(CoreExtension::getAttribute($this->env, $this->source, (isset($context["relation"]) || array_key_exists("relation", $context) ? $context["relation"] : (function () { throw new RuntimeError('Variable "relation" does not exist.', 9, $this->source); })()), "name", [], "any", false, false, false, 9));
yield "</h5>
<span class=\"";
// line 10
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 10, $this->source); })()), "html", null, true);
yield "\">";
{
$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());
}
<div class=\"pt-24px w-100 col-md-8 px-0 px-md-15px d-lg-none\">
<h4 class=\"text-dark-primary ff-semibold fs-basic\">Consultez aussi</h4>
<div class=\"pt-12px object-recom\">
";
// line 95
yield from $this->load("article/_recommandations.html.twig", 95)->unwrap()->yield($context);
// line 96
yield " </div>
</div>
</div>
{
$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());
}
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.
*
$content = $enquete->description;
$twig = Twig::LoadTwig();
return $twig->render(
'enquete/show.html.twig',
[
'enquete' => $enquete,
'tags' => $tags,
'image' => $image,
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);
get_header();
//$cache->delete($code);
echo $cache->get(
$code.time(),
function () use ($blodId, $enqueteId) {
$twig = Twig::LoadTwig();
$enquete = WpRepository::getEnquetePublique($enqueteId);
*
* @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: Neither the property "name" nor one of the methods "name()", "getname()"/"isname()"/"hasname()" or "__call()" exist and have public access in class "stdClass" in "article/_recommandations.html.twig" at line 9. at /var/www/marchebe/wp-content/themes/marchebe/templates/article/_recommandations.html.twig:9 at Twig\Extension\CoreExtension::getAttribute() (/var/www/marchebe/var/cache/twig/9f/9f082ce3888ebb5e9cf7dbe98d3720a2.php:64) at __TwigTemplate_5009bcfe75241f8675909cc1fa3c98e5->doDisplay() (/var/www/marchebe/vendor/twig/twig/src/Template.php:402) at Twig\Template->yield() (/var/www/marchebe/var/cache/twig/aa/aa2e7e1e55680305976d2c1c67e5bc10.php:162) at __TwigTemplate_9d09a478bb655943967ee0877181193e->doDisplay() (/var/www/marchebe/vendor/twig/twig/src/Template.php:402) at Twig\Template->yield() (/var/www/marchebe/var/cache/twig/eb/ebb96a910596ba9fd07052a3405bfc30.php:49) at __TwigTemplate_d3ed1df8ea8bac13eb12ba42d34a77f1->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-enquete.php:74) 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-enquete.php:22) at include('/var/www/marchebe/wp-content/themes/marchebe/single-enquete.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) |