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.
Comment | File | Size | Author |
---|---|---|---|
#2 | sitemap_not_language_aware-2987673-2.patch | 718 bytes | SurfinSpirit |
Comments
Comment #2
SurfinSpirit CreditAttribution: SurfinSpirit at FFW commentedAttaching the patch that fixes the issue.
Comment #3
zread CreditAttribution: zread commented+1
Tested the patch and it seems to work for me.
Comment #4
pifagorComment #5
pifagorComment #7
pifagor