Display only fields (hook_entity_extra_field_info) are ignored

Created on 25 January 2024, about 1 year ago
Updated 8 February 2024, about 1 year ago

Problem/Motivation

If you declare a field through hook_entity_extra_field_info or the extra_field module, you can configure it just fine on the field group props, but it is not rendered.

This is because the Util::computePropValues method excludes anything that is not a field.

$skip_static_mapping =
  !empty($field_name)
  && $entity instanceof FieldableEntityInterface
  && $entity->hasField($field_name)
  && !$entity->get($field_name)->isEmpty();

Proposed resolution

Include the view mode and get the display components from the display object, I'm adding a MR with a proposed solution but I'm 100% sure that there's a better way to do this as I'm focusing on the field group bit of the module right now and maybe can be included in a more general way.

Remaining tasks

Find a better way to pass the view mode.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇪🇸Spain pcambra Asturies

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024