Display only fields (hook_entity_extra_field_info) are ignored

Created on 25 January 2024, 5 months ago
Updated 8 February 2024, 5 months 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 Spain, πŸ‡ͺπŸ‡Ί

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024