Quantcast
Channel: Issues for XML sitemap
Viewing all articles
Browse latest Browse all 1238

xmlsitemap_menu failing to properly create sitemaps for other languages.

$
0
0

Problem:

Sitemap generation would only work for the current language - other languages would be incomplete or contain links to the wrong nodes.

Steps to reproduce;

1. Install Drupal 7, i18n and xmlsitemap.
2. Set up multiple languages, create some translated nodes with custom paths.
3. Set up a menu - set the menu translation mode to "Translate and Localize"
4. Create menu items for different languages, to the various different nodes.
5. On the front end, the menu will only show items that match the current language - so you can swap out menu items for specific languages.
6. Create a sitemap for each language.
7. Run Cron. The site map for the current language will populate correctly, other languages will display incorrect links, and without their aliases.

I tracked the problem down the xmlsitemap_menu_create_link function.

This was looking for the menu item's language in the wrong place, so all menu items were given "language undefined" UND.

Also the way that the menu works in "Translate and Localize" mode is that when the menu is displayed, any menu items that don't match the current language (or are language neutral) are hidden. This causes all other links to be set as inaccessible in the xmlsitemap table.


Viewing all articles
Browse latest Browse all 1238

Trending Articles