Closed tuaris closed 2 years ago
@tuaris Thanks for making a PR! I just found this -- can you open an issue with steps to reproduce / test and link to this PR?
I can't reproduce this problem. I tried changing the Default Base URL to http://example.com
and it works for the links in my sitemap. While using +=
indeed only adds a key if none is present, it looks like in my testing there isn't a base_url
present before the operator, so the base URL from the sitemap config always works.
Could you try the latest release of the module and see if this is still a problem? There were some base_url fixes that were merged in issue #72.
@tuaris I'm going to close this PR for now. If you are still having an issue with the latest version, please open an issue with steps to reproduce. Thanks!
The
base_url
when specified in "Default base URL" under Advanced settings isn't being applied due to the way the array is being merged using the+=
operator. I'm not 100% sure what the purpose of using this method to merge the arrays is. This 'fix' uses a similar workaround is present inxmlsitemap.xmlsitemap.inc
. I think a more appropriate approach would be to use array_merge() or just assign the overriding values to the elements individually.