Really nice module, but i have a problem with accentuated characters.
For the moment i only see the problem with page titles > Title: [current-page-title]
It seems that some accents are not supported, am i right ?

Comments

dave reid’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

What kind of problem? Can you be more specific?

jmix’s picture

Sorry, i missed your message.
When i activate Meta-tags module, my page titles are misinterpreted if i have accentuated or special characters.

For exemple if my page title is l'art dans les chappelles, and if i set the rule to "page titles > Title: [current-page-title]", the output in the browsers' page title will be l’art dans les chapelles.
A problem of character encoding in the module i guess.

No problem when the module is not activated.

Thanks for your help !

Ramsos’s picture

Component: Miscellaneous » Code
Status: Postponed (maintainer needs more info) » Needs work

Hi, I encounter the same issue and I worked around by doing this replacement in the metatag.inc file.

Initial code :

class DrupalTitleMetaTag extends DrupalTextMetaTag {

  public function getElement(array $options = array()) {
    $element = array();
    $value = checkplain($this->getValue($options));
    $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'head_title', $value);
    $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'head_array', array('title' => $value));
    return $element;
  }
}

Replaced by :

class DrupalTitleMetaTag extends DrupalTextMetaTag {

  public function getElement(array $options = array()) {
    $element = array();
    $value = $this->getValue($options); //<-- HERE !!!! 
    $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'head_title', $value);
    $element['#attached']['metatag_set_preprocess_variable'][] = array('html', 'head_array', array('title' => $value));
    return $element;
  }
}

As you see, I removed the check_plain on the getValue as it's not needed : the value is already escaped by Token and so this double escape is the problem.
Regards,

jmix’s picture

Thanks so much !!!
I'll try this as soon as i can !
I'm not very familiar with the git thing but i guess this should be proposed as a patch for the next release !

dave reid’s picture

Status: Needs work » Fixed

I think this has already been fixed in 7.x-1.x-dev. Please confirm.

Status: Fixed » Closed (fixed)

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

jmix’s picture

Ok, i tottaly forgot this thread...
Fix from Ramsos is ok (not sure but i think latest devs release didn't do it totally: it displays well in browser's title but not in page code. So i guess it can be a problem for seo, but perhaps i'm wrong ?).
Thanks and sorry for late answer...

dave reid’s picture

Make sure to upgrade to the latest code from Token. There was a patch to ensure that we get the raw value from current-page:title.

drupal_jon’s picture

Hi, I'm having a similar problem in meta descriptions.

The dev release fixed most special characters for me (thanks), but the apostrophe character (') is still being output as &#039;

This is with both manually entered and token replaced meta descriptions.

enricotersi’s picture

I have the same problem described in #9

robhoward79’s picture

I also have the same problem as #9. Fix mentioned in #3 sorted out the page titles, but I cannot see where in the module it is double-escaping the characters in keywords and/or descriptions

giorgosk’s picture

as per last 3 or more reports I opened up a new issue #1957358: description and abstract (possibly others) double encoding bug
please follow the progress there