Create a custom data type and normalizer for string_long

Created on 30 December 2023, 6 months ago
Updated 11 January 2024, 6 months ago

Problem/Motivation

We are currently saving a processed value to the db via massageFormValue() which caused issue with media embeds for example as referenced in https://www.drupal.org/project/custom_field/issues/3410926 πŸ› Media embeds in text fields do not work properly Fixed . The original intent of this decision was to ensure jsonapi value was delivering the processed value for decoupled implementations. The correction in that issue was to simply store the raw value. We still need a solution to get the processed value for jsonapi....

Steps to reproduce

Save a formatted string_long value with patch applied from 3410926 and observe the jsonapi output is not serving the processed text.

Proposed resolution

Create a custom DataType and Normalizer plugin for string_long and return the jsonapi output as an array containing value & processed.

Remaining tasks

Patch forthcoming.

User interface changes

n/a

API changes

Values in jsonapi for string_long will now be returned as object containing value and processed vs. a simple string.

Data model changes

string_long property definition will be using the new DataTypeDefinition.

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States apmsooner

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024