logo
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. (500 Internal Server Error)

Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

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.

Exception

Twig\Error\ RuntimeError

Show exception properties
Twig\Error\RuntimeError {#1674
  -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 {#1876
    -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
}
  1. <i {% if relation.image is defined %}style="background-image: url('{{ relation.image }}');"{% endif %}
  2. class="bg-img-news-1">
  3. <b class="bg-img-bgcolor-hover-primary-55"></b>
  4. </i>
  5. <div class="col">
  6. <h5 class="text-hover-primary">{{ relation.name|puriferHtml|raw }}</h5>
  7. <span class="{{ color }}">{{ blogName }}</span>
  8. </div>
  9. </a>
  10. {% else %}
  11. <a href="#" class="bg-img">
  1. <b class=\"bg-img-bgcolor-hover-primary-55\"></b>
  2. </i>
  3. <div class=\"col\">
  4. <h5 class=\"text-hover-primary\">";
  5. // line 9
  6. 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));
  7. yield "</h5>
  8. <span class=\"";
  9. // line 10
  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);
  11. yield "\">";
  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. <div class=\"pt-24px w-100 col-md-8 px-0 px-md-15px d-lg-none\">
  2. <h4 class=\"text-dark-primary ff-semibold fs-basic\">Consultez aussi</h4>
  3. <div class=\"pt-12px object-recom\">
  4. ";
  5. // line 95
  6. yield from $this->load("article/_recommandations.html.twig", 95)->unwrap()->yield($context);
  7. // line 96
  8. yield " </div>
  9. </div>
  10. </div>
  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. 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. $content = $enquete->description;
  2. $twig = Twig::LoadTwig();
  3. return $twig->render(
  4. 'enquete/show.html.twig',
  5. [
  6. 'enquete' => $enquete,
  7. 'tags' => $tags,
  8. 'image' => $image,
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. get_header();
  2. //$cache->delete($code);
  3. echo $cache->get(
  4. $code.time(),
  5. function () use ($blodId, $enqueteId) {
  6. $twig = Twig::LoadTwig();
  7. $enquete = WpRepository::getEnquetePublique($enqueteId);
include('/var/www/marchebe/wp-content/themes/marchebe/single-enquete.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:
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)