Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
- Standard drupal 8 install.
- Create an Article content without a body.
- Add the Body field to /admin/structure/views/view/content and move it after "Type".
- Check "Hide empty column" for the "Body" field in the Table settings.
Body is not shown in the header but inside the table there's still an empty space. This shifts the table content relative to the header.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#8 | hide-empty-column-2621874-8.patch | 2.59 KB | Lendude |
#8 | hide-empty-column-2621874-8-TEST_ONLY.patch | 1.78 KB | Lendude |
#6 | hide-empty-column-2621874-6.patch | 836 bytes | czigor |
Comments
Comment #2
czigor CreditAttribution: czigor at Liip commentedComment #3
dawehnerComment #4
dawehnerI could imagine that the code in
core/modules/views/views.theme.inc:552
now contains of render arrays instead of just rendered output, so checking forempty()
doesn't work that simple anymore.Comment #5
czigor CreditAttribution: czigor at Liip commentedTests are also coming.
Comment #6
czigor CreditAttribution: czigor at Liip commentedActually, unsetting the header label does not need to be inside the foreach().
Comment #7
dawehnerOh I'm glad that this is the only change needed, nice!
I'd say
\Drupal\views\Tests\Plugin\StyleTableTest
is the perfect place to expand.Comment #8
LendudeTests. Failing patch and patch containing tests and fix in #6.
Interdiff is the test only patch.
Comment #10
dawehnerThank you for that!
Comment #14
alexpottCommitted b845d1b and pushed to 8.0.x and 8.1.x. Thanks!