Provide visibility into field types with different matching SDC prop shapes depending on field storage settings

Created on 13 March 2025, about 1 month ago

Overview

📌 Provide visibility into which (core) field type props can be mapped into Content Type Templates vs not Active added FieldTypeSupportTest, but did it in a way where only the default field storage settings are used. Hence it added this:

@todo test non-default FieldStorageConfig settings?! Impossible to automate to test exhaustively, certainly without fully validatable config schema.

For most field types, this is sufficient. But not for all.

For example, for the datetime field type, the datetime_type storage-level setting results in very different data being stored, and very different SDC prop shapes getting matches:

      // Built-in formats: dates and times.
      // @see https://json-schema.org/understanding-json-schema/reference/string#dates-and-times
      // @see \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem
      static::DATE_TIME => new StorablePropShape(shape: $shape, fieldTypeProp: new FieldTypePropExpression('datetime', 'value'), fieldStorageSettings: ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATETIME], fieldWidget: 'datetime_default'),
      // @see \Drupal\datetime\Plugin\Field\FieldType\DateTimeItem
      static::DATE => new StorablePropShape(shape: $shape, fieldTypeProp: new FieldTypePropExpression('datetime', 'value'), fieldStorageSettings: ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATE], fieldWidget: 'datetime_default'),

\Drupal\experience_builder\JsonSchemaInterpreter\JsonSchemaStringFormat::computeStorablePropShape()

Proposed resolution

Expand FieldTypeTest.

User interface changes

None.

📌 Task
Status

Active

Version

0.0

Component

Shape matching

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

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

Comments & Activities

Production build 0.71.5 2024