Twig provides a test to check if a variable is empty (http://twig.sensiolabs.org/doc/tests/empty.html).
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
- Create a new content type with a text field ›text‹.
- Create a new theme.
- Copy the node templare from core. (core/modules/node/templates/node.html.twig)
- Activate the theme.
- Create a new node of the new content type and enter nothing in the text field.
- Modify the template and use the fields directly.
- Try to test for emptiness.