\Drupal\schema_metatag\Plugin\metatag\Tag\SchemaHasPartBase::outputValue doesn't account for the case where the the $input_value is an array. \Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase::process_item returns an array when a Tag is configured to allow multiple values if there are in fact multiple comma separated values entered. hasPart is configured to allow multiple values. Before the attached patch, when a single value is entered in the UI for hasPart, things work fine, but after multiple values are entered, nothing gets output for hasPart since the code chokes on the array since it's expecting a string.

Please find the patch attached below.

Comments

ShaunDychko created an issue. See original summary.

shaundychko’s picture

Status: Active » Needs review
StatusFileSize
new681 bytes

Status: Needs review » Needs work

The last submitted patch, 2: schema_metatag-multiple-has-part-2939668-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

karens’s picture

Status: Needs work » Fixed

Right idea but the fix is different. I actually want to see an exception if that is not an array because it indicates the code passing this value is wrong. I also added a test for the multiple value for hasPart to be sure it is caught.

Thanks!

  • KarenS committed 0f8d2de on 8.x-1.x authored by ShaunDychko
    Issue #2939668 by ShaunDychko, KarenS: hasPart should allow multiple...

Status: Fixed » Closed (fixed)

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