Default values for properties based on datetime fields are not schema-conformant

Created on 18 June 2025, 6 days ago

Overview

If you have an SDC with a date prop, Experience Builder will mistakenly create a Component config entity for it that doesn't comply with config schema. The component entity will have a default_value: { value: 'whatever' }} structure, which doesn't match the field.value.datetime config schema type from core.

Proposed resolution

@larowlan already went down this rabbit hole and discovered that -- strange as this (and it really is) -- core's doing the right thing here. Date fields use a relative default value that isn't schema-defined.

XB needs to match that by calling \Drupal\Core\Field\FieldItemListInterface::processDefaultValue() on the default values it generates for prop definitions in Component entities. It's forgetting to do that right now, which is why it runs into this bug.

User interface changes

None.

πŸ› Bug report
Status

Active

Version

0.0

Component

Config management

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024