Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Like the D7 version, the D8 version needs to support meta tags that allow multiple values. The attribute 'multiple' was added already (#2613654: Parse image fields for image URLs), now we just need to generally support it.
Comment | File | Size | Author |
---|---|---|---|
#32 | interdiff-28-32.txt | 6.26 KB | idebr |
#32 | 2628934-32.patch | 4.92 KB | idebr |
|
Comments
Comment #2
DamienMcKennaComment #3
mr.baileysMarked #2664062: 'multiple' option not working correctly, e.g. og:see_also as duplicate.
Comment #4
larowlanI proposed #2589203: Explore moving to one field item per metatag instead of a serailized blob for this, but it was voted down
Comment #5
DamienMcKenna@larowlan: I was planning to follow D7's lead by just splitting on a comma, which would automatically make it compatible with tokens that return multiple values.
Comment #6
DamienMcKennaSome support already exists, need to add tests to cover all meta tags that support multiple values.
Comment #7
nikunjkotechaI'm trying to use og_locale_alternative but not able to get it working for multiple values, it simply shows one with all values, any idea if this is fixed already in dev version?
Comment #8
nikunjkotechaI checked dev version and don't see any code for the support, adding patch to allow support for property based meta tags.
Comment #9
nikunjkotechaCorrected output.
Comment #10
nikunjkotechaComment #11
DamienMcKenna@nikunjkotecha: Thanks for putting that together! Lets see what the testbot says.
Comment #13
nikunjkotechaHi Damien, seems for the change in MetatagManager related in failure; either we update the code to avoid suffixing with index for tags that are not multiple or update test case, I'm not able to confirm if other failures are because of this change, but I'll work on them tonight and keep the post updated. Please update here if you find some useful info.
Comment #14
nikunjkotechaRefactoring to get it passing in tests.
Comment #16
flyke CreditAttribution: flyke commentedThis patch cannot be applied against the latest dev version (8.x-1.x-dev)
Comment #17
DamienMcKennaAn attempted reroll.
Comment #19
smazI've tried using the latest patch from #17, but this is just giving me empty tags for everything - just the opening & closing bracket.
I am testing with 8.x-1.2 on Drupal 8.3.5, but I've checked and the only changes between that & dev are modifications to tests - nothing that should affect this.
I'm stepping through things now to see if I can work out the cause.
Comment #20
smazI think there was too much nesting of arrays returned by MetatagManager::generateRawElements().
I've tweaked the patch from #17 slightly to reduce a level of nesting & everything appears to work as it should.
Comment #21
smazUpdating status.
Comment #23
smazThe test failures were because MetaItempropBase needed to handle multiple values too. Patch fixes that.
I also noticed that MetaItempropBase didn't check for replacing secure URLs, so I've added that in too (though maybe that should be a different patch?).
I'm not sure if this is enough though - do all of the base classes need this? And then potentially all of the classes that extend & overwrite this?
Comment #25
e.escribano CreditAttribution: e.escribano commentedI think if the changes are applied to the class MetaNameBase directly, any of the extended classes will handle multiple values.
Comment #26
DamienMcKennaComment #28
e.escribano CreditAttribution: e.escribano commentedNew patch
Comment #29
DamienMcKennaThanks.
BTW please try to remember to change the status to "needs review" after you upload a patch.
That last patch fails again.
Comment #30
DamienMcKennaComment #31
ZapevalovAnton CreditAttribution: ZapevalovAnton as a volunteer commentedPatch #25 not work for me. Metatag 8.x-1.x-dev
Comment #32
idebr CreditAttribution: idebr at ezCompany commented#28 introduced some code duplication over different base classes. Not sure why this was necessary. The 7.x Metatag makes no such distinction, so I moved this code back to MetaNameBase.
Attached patch introduces the following changes:
- Moved support for multiple values back to MetaNameBase
- Added test coverage for an og:image:url metatag with multiple values
- Rerolled against 8.x-1.x
Comment #33
caspervoogt CreditAttribution: caspervoogt at Plethora commentedthe patch from #32 works well for me
Comment #34
DamienMcKennaComment #36
DamienMcKennaCommitted. Thanks everyone!