Active
Project:
Metatag
Version:
2.0.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 May 2024 at 18:49 UTC
Updated:
30 Jan 2026 at 16:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mrcdrx commentedI can confirm this issue.
Comment #3
2dareis2do commentedNot sure if I have found a new bug or if this is related to this one but I also discovered that the use of delimiters in alt tags breaks the meta tag output for images.
In MetaManager->processTagValue() we have the following
This looks like it is using a comma for a delimiter.
In my meta image I had alt tag defined. I had used 2 commas!
e.g.
Removing the use of commas in the alt tag field seems to resolve the issue with og:image being added multiple times. So with an image the site url is also appended. This appears to be repeated depending on how many delimiters you have.
Interestingly the first part of the alt text seems to be ignored but the following delimited strings are prepended.
So to summarise, strings with delimiters appear to be break the token replacement and the number of items returned.
This seems like a potential bug as commas appear to be allowed when entering a string in Drupal?
One solution might be too disable the use of certain delimiters when entering a string in Drupal.
Not sure what the query string issue is exactly but perhaps there is some other character being used as a delimiter when processing tag values?
Might be good to add a test for this scenario.
Comment #4
2dareis2do commentedLooks like a known bug when using commas as delimiters
https://www.drupal.org/project/metatag/issues/2761909
Comment #5
damienmckennaLet's add some test coverage.
Comment #6
justinchev commentedThis token seemed to work for me in order to only render the image url without the alt text and the problem commas.
[node:field_image:entity:url]