Problem/Motivation
We're using the module to externalize review data for doctors. As such, we need to support names such as "Real Doctor, M.D.". The problem is that the comma is interpreted as a multivalue, and thus split, causing a validation failure with the schema.org JSON-LD output.
Steps to reproduce
- Configure a schema.org review metatag for a content type.
- Use [node:title] or [current-page:title] for the name of the review.
- Create a node with a comma in the title.
Proposed resolution
The name field should be added to \Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase::neverExplode(). Or, the explode function should be configurable.
Remaining tasks
Create patch.
User interface changes
Depends on approach.
API changes
Depends on approach.
Data model changes
Depends on approach.
Issue fork schema_metatag-3361262
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
damienmckennaYou might test out #2976935: Improve support for multi-value schema using Metatag's custom separator option to see if it works for you.
Comment #4
damienmckennaComment #6
damienmckennaCommitted. Thank you.
Comment #9
nkasprak commentedIs there a way to provide more flexibility here? My site has many pages with multiple authors and my setup relied on the names being exploded (in conjunction w/ the pivot functionality), and this change broke it. Maybe there's a better way but it seems like in general there are legit cases where you'd want multivalue here.