Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291508

Error messages when compiling twig with calls to theme() have a wrong context

$
0
0

#1880100-48: Allow to configure the h3 element for view style plugins tells something about a missing variable in views-view.html.twig, but the variable was actually missing in a different template.

Steps to reproduce:

  1. Clean install of Drupal 8.
  2. Try to print a template in bartik/templates/node.html.twig that does not exist - {{ badvariable }}
  3. Clear caches.
  4. Visit /node - you should see an exception like the following:

User warning: badvariable could not be found in _context in "core/themes/bartik/templates/page.html.twig" at line 170 in Drupal\Core\Template\TwigTemplate->getContextReference() (line 51 of core/lib/Drupal/Core/Template/TwigTemplate.php).

Since this exception is not coming from upstream Twig internals we should be able to fix it here, and maybe improve the error message while we're at it.


Viewing all articles
Browse latest Browse all 291508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>