Hello,
I am using *two* tokens for the *About* field of the schema_article type metatags. Example:
schema_article.about = [node:field_foo], [node:field_bar]
Sometimes one or both of these tokens are empty. This produces values like ", ", ", Foo, Bar", etc.
For the first case (i.e. ","), SchemaMetatagManager::explode() produces a PHP warning when it tries to access the nonexistent $exploded[0].
For the second case (i.e. ", Foo, Bar"), the Json+LD output displays the numeric IDs which leads to validation failure. Example output:
...
"about": {
"1": " Foo",
"2": " Bar"
},
...
The proposed patch avoids these issues. I have also taken the liberty to trim the exploded values which is already covered in a different ticket for the 8.x -1.x branch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2934414-validation-failure-for-comma-separated-field-values.patch | 770 bytes | progga |
Comments
Comment #2
damienmckennaDid you mean to upload a patch? :)
Comment #3
progga commentedComment #4
karens commentedThere have been multiple changes since this was reported and I don't think this is a problem any more. You can report steps to reproduce if you still have problems in the very latest code.