drupal_field() doesn't work with media entities

Created on 11 April 2023, about 1 year ago
Updated 24 April 2023, about 1 year ago

Problem/Motivation

drupal_field(field_name, entity_type, id) doesn't work with media entities.

Steps to reproduce

I have the following media entity:
image


entityTypeId = "media" and mid = "14"


I tried outputting the image field using the following code:
{{ drupal_field('field_media_image', 'media', 14) }}

However, nothing is output, and there are no error messages.
Other people have reported the same problem but not as a separate issue: https://www.drupal.org/project/twig_tweak/issues/3198627#comment-14000078 β†’

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: works as designed

Version

2.10

Component

Code

Created by

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

Comments & Activities

Production build 0.69.0 2024