FieldPropExpression validation error when multiple bundles share the same field name in prop name mapping.

Created on 23 September 2025, 10 days ago
Updated 26 September 2025, 8 days ago

Overview

When altering the image component via the storage_prop_shape_alter() hook, if multiple target bundles are added and different prop names are needed per media type. Then prop names are defined as an array, and they are keyed by the field name. However, if some media types share the same media source and thus the same field name, the prop name array's size does not match the bundle array's size. This causes the following error in FieldPropExpression:

In FieldPropExpression.php line 81:
  A field property name must be specified for every field name, and in the same order.

Example Expression

ℹ︎entity_reference␟{src↝entity␜␜entity:media:acquia_dam_image_asset|custom_acquia_dam_image|image␝acquia_dam_image_item|acquia_dam_image_item|field_media_image␞␟src_with_alternate_widths|src_with_alternate_widths,alt↝entity␜␜entity:media:acquia_dam_image_asset|custom_acquia_dam_image|image␝acquia_dam_image_item|acquia_dam_image_item|field_media_image␞␟alt|alt,width↝entity␜␜entity:media:acquia_dam_image_asset|custom_acquia_dam_image|image␝acquia_dam_image_item|acquia_dam_image_item|field_media_image␞␟width|width,height↝entity␜␜entity:media:acquia_dam_image_asset|custom_acquia_dam_image|image␝acquia_dam_image_item|acquia_dam_image_item|field_media_image␞␟height|height}

Expected Result

It should be possible to map different prop names per bundle, even if multiple bundles share the same field name.

Actual Result

Validation fails due to array size mismatch between bundles and prop names, blocking the configuration.

Impact

Cannot support multiple media types with shared field names and distinct prop mappings.

🐛 Bug report
Status

Active

Version

1.0

Component

Shape matching

Created by

🇮🇳India vishalkhode

Live updates comments and jobs are added and updated live.
  • Contributed project blocker

    It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024