Commit 8a34de3e authored by git's avatar git Committed by RenatoG

Issue #2257191 by Diego_Mow, gapple, Yaron Tal, mhmhartman, alex.designworks,...

Issue #2257191 by Diego_Mow, gapple, Yaron Tal, mhmhartman, alex.designworks, spidersilk, Gomez_in_the_South, G2, contentsuit, darrenwh, giupenni, JAINV18, odrzutowiec: Remove duplicate links when using both menu and node sitemap
parent 22730fdd
...@@ -265,6 +265,17 @@ function xmlsitemap_menu_create_link(array $menu_item) { ...@@ -265,6 +265,17 @@ function xmlsitemap_menu_create_link(array $menu_item) {
$menu_item['xmlsitemap']['access'] = $menu_item['access'] && !$menu_item['external'] && !$menu_item['hidden']; $menu_item['xmlsitemap']['access'] = $menu_item['access'] && !$menu_item['external'] && !$menu_item['hidden'];
$menu_item['xmlsitemap']['language'] = isset($menu_item['options']['langcode']) ? $menu_item['options']['langcode'] : LANGUAGE_NONE; $menu_item['xmlsitemap']['language'] = isset($menu_item['options']['langcode']) ? $menu_item['options']['langcode'] : LANGUAGE_NONE;
// Exclude menu items created for nodes that are added by xmlsitemap_node.
if ($menu_item['xmlsitemap']['access'] && $menu_item['router_path'] == 'node/%' && module_exists('xmlsitemap_node')) {
$node = node_load(substr($menu_item['link_path'], 5));
if (empty($node->xmlsitemap)) {
xmlsitemap_node_create_link($node);
}
if ($node->xmlsitemap['status'] && $node->xmlsitemap['access']) {
$menu_item['xmlsitemap']['status'] = FALSE;
}
}
return $menu_item['xmlsitemap']; return $menu_item['xmlsitemap'];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment