[later phase] When the field type for a PropShape changes, the Content Creator must be able to upgrade

Created on 26 July 2024, 9 months ago

Overview

Discovered while discussing #3461499-17: Support complex SDC prop shapes: introduce (Storable)PropShape to compute field type storage settings in-depth with @lauriii.

Hypothetical scenario:

  1. A component has a prop with the schema {type: string, format: date}.
  2. This component has that prop populated by a StaticPropSource that uses core's datetime field type, with the datetime_type setting set to date.
  3. The Site Builder decides that actually, this should be handled by a different field type: the timestamp field type, plus the unix_to_date adapter (which already exists: \Drupal\experience_builder\Plugin\Adapter\UnixTimestampToDateAdapter).

Existing content will continue to work, because the StaticPropSource is self-contained. It will continue to use the datetime field type.

But this also means the UX will be different: a different widget is presented.

So the Content Creator should have the ability to update the component's existing stored props to whichever the updated default field types are for each prop shape.

Proposed resolution

Something like:

(hacked together by @lauriii — different wording obviously, because this is not a different "component version")

Implementation: TBD. In the example above, the data that is stored is very different: something like 2024-07-26 vs 1721992490. How do we transform from one to the other?

Related: 📌 Prevent modules from being uninstalled if they provide field types used in an Experience Builder field Fixed and follow-ups: because an alternative to the above could be that any such change should have an accompanying update hook.

User interface changes

TODO: screenshots

📌 Task
Status

Postponed

Component

Page builder

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