The NodeJsonOutput tests are currently failing, e.g. https://www.drupal.org/pift-ci-job/752648. Fix this.
The MetatagNormalizer::normalize() method assumes that all meta tags have a "content" attribute because it does this:
foreach ($tags['#attached']['html_head'] as $tag) {
$normalized['value'][$tag[1]] = $tag[0]['#attributes']['content'];
}
Obviously not all meta tags have a "content" element, e.g. LINK tags actually use the "href" attribute.
When the above code is running the $tag array will look something like this:
Array (
[0] => Array (
[#tag] => link
[#attributes] => Array (
[rel] => canonical
[href] => http://replacements.mcdev/myaccount/304548
)
)
[1] => canonical_url
)
I think we're going to need to add some logic to load the appropriate class based upon $tag[1] and use it to identify what the "value" is.
Of course this won't work if the meta tag has multiple "values", e.g. MaskIcon.
Comment | File | Size | Author |
---|---|---|---|
#4 | metatag-n2905925-4.patch | 1019 bytes | DamienMcKenna |
|
Comments
Comment #2
DamienMcKennaSo it turns out that the bug is a problem in the normalizer.
Comment #3
DamienMcKennaComment #4
DamienMcKennaThis makes the normalizer support "content" and "href" attributes, but it'll require further work to do a proper fix.
Comment #5
DamienMcKennaI created #2906257: Refactor normalizer so each tag can format its output individually to work out a longer-term fix.
Comment #7
DamienMcKennaCommitted.