Problem/Motivation

Introduced by https://www.drupal.org/node/1396220
https://www.drupal.org/files/issues/xmlsitemap-xmlsitemap-generate-chunk...

$link['language'] = is_object($link['language']) ? $link['language']->language : $link['language'];
rewrites the language object by its language code because xmlsitemap_get_path_alias is executed on the next line, on the other hand the url function here $link_url = url($link['loc'], $link_options + $url_options); needs a language object in order to operate properly.

After this change multilingual sitemaps use default base url instead of per language value.
Thanks marco-s for noticing https://www.drupal.org/project/xmlsitemap/issues/1396220#comment-12652047

Proposed resolution

Given the previous change was done because xmlsitemap_get_path_alias function uses language code to do the query but url function needs the language object do not override the object by language code but instead send each function the value it requests.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SurfinSpirit created an issue. See original summary.

SurfinSpirit’s picture

Status: Active » Needs review
FileSize
718 bytes

Attaching the patch that fixes the issue.

zread’s picture

+1

Tested the patch and it seems to work for me.

pifagor’s picture

Status: Needs review » Reviewed & tested by the community
pifagor’s picture

  • pifagor committed 2852e97 on 7.x-2.x authored by SurfinSpirit
    Issue #2987673 by SurfinSpirit, pifagor, zread: Sitemap is not language...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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