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).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | schema_metatag-3340320-4.patch | 447 bytes | dchaffin |
| #2 | schema_metatag-3340320-2.patch | 454 bytes | eeyorr |
Issue fork schema_metatag-3340320
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 #2
eeyorrPatch attached.
Comment #3
damienmckennaThank you for reporting the bug and for adding the patch.
Let's see what the testbot says.
Comment #4
dchaffin commentedI went to apply the patch from #2 and it looked as though the lines had shifted later in the file, so I created a new patch to test.
Comment #7
rajeshreeputraOpened MR for ease of merge, accidently I have opened issue for same problem #3367170: output method return should be array linking here, once this get merged will close it.
Changes looks good and works as expected.
@DamienMcKenna this is causing issue with PHP 8.2, so will be good if it get fixes sooner.
Thank you!!!
Comment #8
trickfun commentedWorks as expected.
Thank you
Comment #10
damienmckennaCommitted. Thank you.
Comment #11
rajeshreeputra@DamienMcKenna When can we expect this to be fixed in 2.x
Comment #13
damienmckennaI didn't think of backporting it to 8.x-2.x, so it isn't in the new 8.x-2.5. I did just commit it to 8.x-2.x so if you download the latest 8.x-2.x-dev you'll have it.
Comment #15
damienmckenna