ECA EXTRA FIELD - Empty content view

Created on 25 July 2025, 5 days ago

Problem/Motivation

Steps to reproduce

When we use ECA Extra field - to render a view (or block) it draws it even it is empty (No results behavior).
Normally user would not notice it, but in my case I am using Field Group β†’ module with tabs and tabs are not hidden by default because ECA tries to render an extra field even it is empty.

Example:

Without Field group:

With field group module:

Proposed resolution

Currently we are using following module Entity Extra Field β†’ and there was the same issue described here " 3469612 πŸ› Hide block/view if No results behavior Active but was recently fixed with patch merge request !33. The result is that Entity extra field won't render view or block and Field group tab is hidden by default so if my project don't have any inventory it is not displayed at all.

My plan is to fully replace Entity Extra field module with ECA but that "issue" is blocking that replacement.

Does anyone can check that fix for " 3469612 πŸ› Hide block/view if No results behavior Active and possibly use it as starting point to fix also that ECA Extra field issue ?

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    The link to the MR in entity_extra_field is really helpful, thanks.

    There is a difference in handling, though. ECA's render view action just uses views_embed_view to receive a renderable array. But that doesn't allow testing for an empty result set in the view.

    We would have to re-implement \Drupal\eca_render\Plugin\Action\Views::doBuild entirely by using something like this:

        $view = Views::getView($view_name);
        $view->setDisplay($this->getViewDisplay());
        $view->setArguments($this->getViewArguments($entity));
    
        // Test for empty result set here.
    
        return $view->buildRenderable(
          $this->getViewDisplay(),
          $this->getViewArguments($entity)
    
Production build 0.71.5 2024