When I have empty text on a view with a table display, and I choose the option to render the empty text within the table, it appears within the table and also below it.

Empty text appears twice

Issue fork eva-3111965

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

joelstein created an issue. See original summary.

joelstein’s picture

Related issues: +#3083993: Hide output if empty option
StatusFileSize
new458 bytes

Here's a patch which matches a few lines of template code to what's in views-view.html.twig from Drupal core. This seems to do the trick.

I'm not sure if this is related to #3083993: Hide output if empty option.

joelstein’s picture

Status: Active » Needs review
ahebrank’s picture

Makes sense to me. I'm really hesitant to mess with the default templates, but I can't imagine a scenario where you'd want both {{ rows }} and {{ empty }} to output. Right?

vitaliyb98 made their first commit to this issue’s fork.

vitaliyb98 changed the visibility of the branch 3111965-rendering-empty-text to hidden.

vitaliyb98’s picture

Version: 8.x-2.x-dev » 3.1.x-dev

Hi, this issue is still relevant. The solution provided in the patch is very close to the core view template, so I believe it's safe. However, for some reason, the {{ pager }} was removed in the patch.

I've submitted a merge request with the fix and also added a functional test.

terry_kolodiy’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +LutskGCW26

Hi!

I've reproduced this issue, and yes, it renders empty text twice because of missing checks.
MR fixes this bug, and the functional test is successful

Thanks for your fix. I'm sure it can be merged

  • vitaliyb98 committed 62f38dcc on 3.1.x
    Issue #3111965: Fixed issue with double empty text behaviour and cover...
vitaliyb98’s picture

Status: Reviewed & tested by the community » Fixed

@terry_kolodiy, thanks for your testing and review. I also fixed the MR conflict.

Merged into 3.1.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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