- Issue created by @jacobadeutsch
- Status changed to Postponed: needs info
7 days ago 1:27pm 26 May 2025 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Can you still reproduce this? And if so, can you please provide the SDC that reproduces this as a patch, an MR or a link to a repo? 🙏 That's way easier for us to reproduce than watching this video 😇
This is because the $ref for images only applies to the image variable in twig, and doesn't apply based on the prop name.
That'd surprise me a lot, because the logic that 📌 Support complex SDC prop shapes: introduce (Storable)PropShape to compute field type storage settings Fixed introduced definitely does not look at the name of the prop. It was introduced in August 2024 (months before this bug report) and is still unchanged today:
JsonSchemaType::OBJECT => match (TRUE) { array_key_exists('$ref', $schema) => match ($schema['$ref']) { // @see \Drupal\image\Plugin\Field\FieldType\ImageItem // @see media_library_storage_prop_shape_alter() 'json-schema-definitions://experience_builder.module/image' => new StorablePropShape(shape: $shape, fieldWidget: 'image_image', fieldTypeProp: new FieldTypeObjectPropsExpression('image', [ 'src' => new ReferenceFieldTypePropExpression( new FieldTypePropExpression('image', 'entity'), new FieldPropExpression(EntityDataDefinition::create('file'), 'uri', NULL, 'url'), ), 'alt' => new FieldTypePropExpression('image', 'alt'), 'width' => new FieldTypePropExpression('image', 'width'), 'height' => new FieldTypePropExpression('image', 'height'), ])), default => NULL, }, default => NULL, },
+
\Drupal\experience_builder\Hook\ShapeMatchingHooks::mediaLibraryStoragePropShapeAlter()
. - 🇫🇮Finland lauriii Finland
I can't reproduce this anymore. Back in October we had a myriad of media related bugs so this could have been fixed by one of those.