The entity view block is rendered even though the active fields of the referenced view mode are empty

Created on 13 May 2024, about 2 months ago
Updated 18 June 2024, 10 days ago

Problem/Motivation

The entity block (view) that references a view mode of the same entity in which the active fields are empty is rendered.

Steps to reproduce

For example, using Layout Builder:

  1. Enable Layout Builder and ctools.
  2. Manage layout on Default view mode.
  3. Add the Entity block and choose any view mode in which you have any fields configured that are not in the default view mode.
  4. View the entity and the block will be displayed even if the fields are empty.

Proposed resolution

I have created a patch where I filter out active fields that are not base fields and are not empty.
If all active fields that are not base fields are empty, it returns an empty array.

πŸ› Bug report
Status

Needs review

Version

3.14

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain einarulfhednar

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

Comments & Activities

Production build 0.69.0 2024