Closed (fixed)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
12 Feb 2013 at 16:38 UTC
Updated:
26 Feb 2013 at 17:00 UTC
When both Metatag and Global redirect are configured to output canonical tags, the end result is duplicate tags. For some reason the checking in metatag_html_head_alter() is only overriding core tags, but not the Global redirect one, which is added with the following code in globalredirect_init():
drupal_add_html_head_link(array(
'rel' => 'canonical',
'href' => url(drupal_is_front_page() ? '<front>' : $request_path, array('absolute' => TRUE, 'query' => $query_string)),
));
Comments
Comment #1
dave reidAh, I'm guessing that it's because we have a break; call in the foreach() loop in metatag_html_head_alter(). It needs to check all entries in $elements and not just assume there is only one.
Comment #2
dave reidFixed with http://drupalcode.org/project/metatag.git/commit/0648e28