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.
as per last reports here #1319546: Problem with french accents
and my own observation adding description manually gets double encoded so characters like
ampersand and apostrophe & '
get outputed as ' &
Comment | File | Size | Author |
---|---|---|---|
#23 | metatag-n1957358-23.patch | 4.46 KB | DamienMcKenna |
#19 | metatag-n1957358-19.patch | 7.61 KB | DamienMcKenna |
#15 | metatag-n1957358-15.patch | 6.92 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaThis problem does not happen in the current -dev version, it correctly handles string encoding.
Comment #2
DamienMcKennaNow that v7.x-1.0-beta7 is out, I'm closing this in the interest of keeping the issue queue clean.
Comment #3
haysuess CreditAttribution: haysuess commentedI'm using Metatag beta 9 and Token 1.5.
Any special characters like quotes in my titles or even the body of my content is not properly displayed.
See below (with some properties shortened for easier reading):
You'll see there's a ton of & # 0 3 9 ;
Do I need to upgrade my modules or is there something else going on?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous at XIO commentedI'm reopening this, since I'm still able to reproduce this on a clean D7 install and the metatag HEAD. See attached a test to demonstrate the issue.
Comment #5
DamienMcKennaThanks for the test. As a reminder, you need to set the issue status to "needs review" to trigger the tests.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous at XIO commentedThe needs work was for not having a fix yet :)
To clarify:
This should not pass. Actually, we might want to change that to assertNoRaw() to demonstrate the issue better.
I didn't find the time yet to investigate where the double escaping comes from though.
Comment #7
DamienMcKennaThe test should also query the database to confirm how the data is stored.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous at XIO commentedComment #10
geertvd CreditAttribution: geertvd at XIO commentedThis seems to be quite urgent for us so I'm gonna have a look at this.
Comment #11
DamienMcKennaFYI this should be moved to a generic tests/metatag.text_encoding.test file rather than being dependent upon the OpenGraph module.
Comment #12
geertvd CreditAttribution: geertvd at XIO commentedActually, after having a closer look, it's seems perfectly normal for these characters to be escaped.
As far as I can see nothing is being double escaped here, the test in #8 also doesn't show that, so for me this is a non-issue, but I'll leave that to @DamienMcKenna to decide.
Comment #13
DamienMcKennaI'm looking into this a little more as one of our sites reported the problem too.
Comment #14
DamienMcKennaI've renamed the class as I suggested above.
Comment #15
DamienMcKennaI've added another file that simple enables i18n, this will play into #2564483: Cannot translate metatags after last update anymore to make sure that nothing breaks when i18n is enabled.
Comment #16
DamienMcKennaCommitted. Thanks!
Comment #18
DamienMcKennaNeed to extend this to cover the title tag too. Duh.
Comment #19
DamienMcKennaI refactored the code so there's just one method that does the testing, and three methods that pass in different types of strings.
Comment #20
DamienMcKennaCommitted.
Comment #22
DamienMcKennaThe tests need to be expanded to cover the node's meta tags too, because those are handled different internally than the config values. Gah.
Comment #23
DamienMcKennaThis improves title handling, and adds tests.
Comment #25
DamienMcKennaCommitted. Again.
Comment #27
torsti CreditAttribution: torsti as a volunteer commentedHi,
I'm using the lates dev, but title tag still contains characters like:
<title>Jäsenmaksut</title>
it should be:
<title>Jäsenmaksut</title>
All other Metatag information is outputted ok. My site's default language is Finnish.
Comment #28
DamienMcKennaFYI it's completely OK for it to have HTML entities in the title, but it shouldn't be double-encoded :-\
Can you please test the patch in #2564483: Cannot translate metatags after last update anymore to see if that fixes the problem for you?
Comment #29
torsti CreditAttribution: torsti as a volunteer commentedHi Damien,
Yes, the patch worked - title tag is ok again. Thanks a lot!
Closing this issue again.