Empty token value causes TypeError

Created on 8 February 2023, almost 2 years ago
Updated 14 July 2024, 6 months ago

Problem/Motivation

I have a date field that populates SCHEMA.ORG: ARTICLE dateModified via a token.

When the field is empty, I get this error because SchemaNameBase::output() returns an empty string instead of an empty array:

TypeError: Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase::output(): Return value must be of type array, string returned in Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase->output() (line 139 of modules/contrib/schema_metatag/src/Plugin/metatag/Tag/SchemaNameBase.php).

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇸United States eeyorr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024