Twig provides a test to check if a variable is empty (
This test fails on Drupal 8 fields.

I came across this issue, as I tried to build a complex layout with Drupal 8 beta 4

Steps to reproduce

  1. Create a new content type with a text field ›text‹.
  2. Create a new theme.
  3. Copy the node templare from core. (core/modules/node/templates/node.html.twig)
  4. Activate the theme.
  5. Create a new node of the new content type and enter nothing in the text field.
  6. Modify the template and use the fields directly.
  7. Try to test for emptiness.


idebr’s picture

derheap’s picture

Issue summary: View changes
lauriii’s picture