I have another module which adds code to $variables['head'] in the preprocess and it runs before nodewords. All was working fine until I updated to 6.x-1.11.
Maybe something changed - but in the new one, $variables['head'] is defined as:
$variables['head'] = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n" .
$output . "\n" .
drupal_set_html_head();
My module - as most modules, including nodewords - simply append their changed to head, not rewrite it with the output of drupal_set_html_head(). This means nodewords is overwriting any previous changes, such as adding code required by Google Ad Manager.
I fail to see what this does instead of just appending to head... drupal_get_html_head contains all that is needed apart from nodewords code.
If the problem is more about other modules adding meta tags, maybe some Regex could be used to replace them out of the head (something like... "|<meta.+?/>|i"?)
My fix is simply:
$variables['head'] .= $output . "\n";
instead of the earlier code (line 542 in 6.x-1.11)...
Comments
Comment #1
avpadernoI have changed the code to not call
drupal_set_html_head()(even though it should return the same value returned bydrupal_get_html_head(), with the difference thatdrupal_get_html_head()add the content type header).See #671128: Bing authentication failure for the reason of why Nodewords needs to add its meta tags before other tags.
Thanks for your report.