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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Grayside created an issue. See original summary.

Grayside’s picture

DamienMcKenna’s picture

Status: Active » Needs review

DamienMcKenna’s picture

Status: Needs review » Fixed
Parent issue: » #2563613: Plan for Metatag 8.x-1.0 release

Committed. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.