Problem/Motivation
The core Typed Data API provides the data descriptions and interaction touchpoints when working with content. While the Metatag module has a Typed Data definition in place, it does not effectively convey the unique metatag semantics of the data. This limits what modules using the Typed Data API can do in interpreting what Metatag fields are all about (e.g., do you need to unserialize the data?)
This is needed in order for the Schemata project's #2825218: Support Metatag module to correctly describe the output of #2636852: Make Metatag fields available as JSON
Proposed resolution
The MetatagFieldItem currently defines it's value using the string
type. Let's define a metatag
type that modules can use to recognize when they've got a metatag.
A number of the typed data types extend from the string type. This can be seen on api.d.o. Like the change I propose here, we would define effectively empty classes that extend the String behavior, much as the URL type does.
Remaining tasks
Upload patch & review.
User interface changes
None.
API changes
Plugin addition for Typed Data API support.
Data model changes
TypedData definitions will retrieve items of the metatag type rather than the string type. Functionally this will be a B/C break only for code that's checking explicitly for the string
type. Since a good coding practice would likely use something compatible with that as a fallback in the event an unrecognized type is encountered, I think this issue is unlikely and solvable.
Comment | File | Size | Author |
---|---|---|---|
#2 | metatag-typed-data-2825867-2.patch | 1.67 KB | Grayside |
Comments
Comment #2
Grayside CreditAttribution: Grayside at Phase2 for Norwegian Cruise Line commentedComment #3
DamienMcKennaComment #5
DamienMcKennaCommitted. Thanks!