Postponed (maintainer needs more info)
Project:
XML sitemap
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Sep 2012 at 01:59 UTC
Updated:
6 Sep 2012 at 11:15 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedResolution of the link is provided to us by core Drupal. Have you considered the Global Redirect module?
Comment #2
testosterone_z commentedThank you for your prompt answer.
I'll try to clear things up a bit:
I'd like to generate one "sitemap.xml" containing all menu links of a drupal 6 website. The website has content in two languages: german (default) and english. Language negotiation is configured to use "path prefix only". The website doesn't use the "i18n" module, only the standard "locale" module. The site has two custom language specific menus ("Primary links (DE)", "Primary links (EN)", "Secondary links (DE)" and "Secondary links (EN)". The default "Primary" and "Secondary" links menus are disabled.
After including the menus on the xmlsitemap configuration page, the "sitemap.xml" did contain all menu links, but only the links from the "german" menus were printed as url aliases. The links from the "english" menus were given as "node/NID".
While browsing the "xmlsitemap_menu.module" code, I came to the conclusion, that the function "xmlsitemap_menu_create_link" is missing one option to set the correct language for a given menu link ($menu_item['xmlsitemap']['language']).
As far as i can tell, "$menu_item['options']['langcode']" will only be set by the "i18nmenu" module. If a menu link is created without this module, the "$menu_item['options'] will contain no language information whatsoever.
But one could query the "url_alias" table for the language entry of the "$menu_item['link_path']" and use that value for the "$menu_item['xmlsitemap']['language']" field.
Original function:
Function with url alias language check:
This seems to work fine so far, because it only sets the correct language in the "xmlsitemap" table.
This code change most likely isn't good at all. But i think it get's the idea across. Hopefully you'll be able to find a better solution.
Comment #3
Anonymous (not verified) commentedI feel a touch of déjà vu.
I remember some issue about the path module dealing with the language. I don't have any time to go researching it but if there is an issue it is with core. Your additional query will slow down an already slow process.