Problem/Motivation

  1. Standard drupal 8 install.
  2. Create an Article content without a body.
  3. Add the Body field to /admin/structure/views/view/content and move it after "Type".
  4. 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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

czigor created an issue. See original summary.

czigor’s picture

Issue summary: View changes
dawehner’s picture

Issue tags: +Needs tests
dawehner’s picture

I 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 for empty() doesn't work that simple anymore.

czigor’s picture

Status: Active » Needs review
FileSize
777 bytes

Tests are also coming.

czigor’s picture

FileSize
836 bytes

Actually, unsetting the header label does not need to be inside the foreach().

dawehner’s picture

Oh 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.

Lendude’s picture

Tests. Failing patch and patch containing tests and fix in #6.

Interdiff is the test only patch.

The last submitted patch, 8: hide-empty-column-2621874-8-TEST_ONLY.patch, failed testing.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for that!

The last submitted patch, 8: hide-empty-column-2621874-8-TEST_ONLY.patch, failed testing.

  • alexpott committed fcbf91b on 8.1.x
    Issue #2621874 by czigor, Lendude, dawehner: "Hide empty column" only...

  • alexpott committed b845d1b on
    Issue #2621874 by czigor, Lendude, dawehner: "Hide empty column" only...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed b845d1b and pushed to 8.0.x and 8.1.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.