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.

Comments

progga created an issue. See original summary.

damienmckenna’s picture

Did you mean to upload a patch? :)

progga’s picture

karens’s picture

Status: Needs review » Fixed

There 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.

Status: Fixed » Closed (fixed)

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