If you are having multilingual site, only system installation specific language sitemap is submitted to search engines - multiple number of times.
Problems lies in xmlsitemap_engines_submit_sitemaps function where original $url variable gets override inside foreach loop (and xmlsitemap_engines_prepare_url function is unable to replace [sitemap] token with proper sitemap url]
Original:
function xmlsitemap_engines_submit_sitemaps($url, $sitemaps = array()) {
foreach ($sitemaps as $sitemap) {
$url = xmlsitemap_engines_prepare_url($url, $sitemap);
$request = drupal_http_request($url);
watchdog('xmlsitemap', 'Submitted the sitemap to %url and received response @code.', array('%url' => $url, '@code' => $request->code));
}
}
Corrected:
function xmlsitemap_engines_submit_sitemaps($url, $sitemaps = array()) {
foreach ($sitemaps as $sitemap) {
$url_submit = xmlsitemap_engines_prepare_url($url, $sitemap);
$request = drupal_http_request($url_submit);
watchdog('xmlsitemap', 'Submitted the sitemap to %url and received response @code.', array('%url' => $url_submit, '@code' => $request->code));
}
}
Comments
Comment #1
dave reidGah, took me a while to find exactly what was going wrong but finally I see it. Will work on fixing this and getting a test case to cover it. Will need to fix in 7.x-2.x and then backport.
Comment #2
Anonymous (not verified) commentedHappy to test the backport once the patch is in for 6.x-1
Comment #3
dave reidAlright I fixed this in 6.x-2.x and 7.x-2.x and wrote some tests to back it up.
http://drupal.org/cvs?commit=322466
http://drupal.org/cvs?commit=322468
http://drupal.org/cvs?commit=322470
http://drupal.org/cvs?commit=322472
Comment #4
Anonymous (not verified) commentedShould we wait for it to be packaged into a new version or should we install the patches directly?