After the installation of the nodewords module, Content-Type meta tag appears twice on all web pages. After analysis of the code, I modified in the function nodewords_preprocess_page the following line:
Original code
/**
* Implements hook_preprocess_page().
*/
function nodewords_preprocess_page(&$variables) {
$result = _nodewords_detect_type_and_ids();
$tags = nodewords_get_tags($result[0], $result[1]);
$parameters = array(
'type' => $result[0],
'ids' => $result[1],
'output' => 'head',
);
drupal_alter('nodewords_tags', $tags, $parameters);
$output = nodewords_output_tags($tags);
drupal_alter('nodewords_tags_output', $output, $parameters);
$variables['head'] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" .
$output . "\n" .
drupal_set_html_head();
}
Updated code
/**
* Implements hook_preprocess_page().
*/
function nodewords_preprocess_page(&$variables) {
$result = _nodewords_detect_type_and_ids();
$tags = nodewords_get_tags($result[0], $result[1]);
$parameters = array(
'type' => $result[0],
'ids' => $result[1],
'output' => 'head',
);
drupal_alter('nodewords_tags', $tags, $parameters);
$output = nodewords_output_tags($tags);
drupal_alter('nodewords_tags_output', $output, $parameters);
// MODIFIED: Remove Content-type meta tag.
$variables['head'] = $output . "\n" .
drupal_set_html_head();
}
And it has me allowed to resolve this problem. Could you place this patch in the future versions of nodewords ?
Thank you.
Comments
Comment #1
avpadernoSee #679322: Duplicated content type meta tag, where it is explained that the meta tag for the content type is output twice by Drupal. You would still see that meta tag appearing twice, even after you disabled Nodewords (or uninstalled it); also in Drupal.org, the content type is output twice (and Drupal.org is not running Nodewords).
The latest Nodewords code has been already changed, though.