The i18n module adds 'en' to $context which is used to generate 'smid'. Therefore, if you have sitemaps that were created before enabling i18n they won't be displayed. Typically:
#1 install xmlsitemap
This generates a sitemap as per xmlsitemap.install.
Blank $context language
$sitemap->smid = xmlsitemap_sitemap_get_context_hash($sitemap->context);
/sitemap.xml loads fine.
#2 install xmlsitemap_i18n
Now in xmlsitemap_sitemap_load_by_contxt we have $context[language] = "en"
This is used to generate the hash that we are looking for. Therefore, it doesn't match.
xmlsitemap.install. I think this should call xmlsitemap_get_current_context(); for consistency although it doesn't fix the problem.
xmlsitemap.module - I also think xmlsitemap_sitemap_load_by_context should do something to report that the smid we were looking for was not found. The xmlsitemap files look OK but still no sitemap.xml is frustrating.
The root fix is to ensure that xmlsitemap_get_current_context() is less fragile? Or cause it to cascade backwards. I have a patch with it cascading backwards.
Usually I don't load modules unless I absolutely have to. Therefore, haven't seen this scenario even after a lot of use. Could be related to http://drupal.org/node/1593508.
Comment | File | Size | Author |
---|
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedHere testbot.
Comment #2
jasom CreditAttribution: jasom commentedWhat is this patch about? I applied it because of #1948480: Language subdomains gives '"Page not found" issue and problem partially disappear:
there is no more Page not found but in generated sitemap for default language are listed also nodes for other domains (languages).
I need site.com/sitemap.xml just with english content.
Comment #3
citywizz CreditAttribution: citywizz commentedWe must keep in mind that it takes to play on the weight in the language detection
en/admin/config/regional/language/configure
1rst choice : URL Determine the language from the URL (Path prefix or domain).
2nd choice : Default - Use the default site language
Comment #4
Chris Matthews CreditAttribution: Chris Matthews commentedxmlsitemap-i18nlost-yy-1.patch:10: trailing whitespace.
// No smid - then at least report it.
xmlsitemap-i18nlost-yy-1.patch:13: trailing whitespace.
// Try without the language.
Checking patch xmlsitemap.module...
Hunk #1 succeeded at 415 (offset 31 lines).
Hunk #2 succeeded at 439 (offset 31 lines).
Applied patch xmlsitemap.module cleanly.
warning: 2 lines add whitespace errors.