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

dave reid’s picture

Version: 6.x-2.0-unstable6 » 7.x-2.x-dev
Assigned: Unassigned » dave reid

Gah, 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.

Anonymous’s picture

Happy to test the backport once the patch is in for 6.x-1

dave reid’s picture

Status: Active » Fixed
Anonymous’s picture

Should we wait for it to be packaged into a new version or should we install the patches directly?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.