backdrop-contrib / xmlsitemap

Provides a sitemap that conforms to the sitemaps.org specification.
GNU General Public License v2.0
1 stars 11 forks source link

base_url isn't being applied #100

Closed tuaris closed 2 years ago

tuaris commented 3 years ago

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 in xmlsitemap.xmlsitemap.inc. I think a more appropriate approach would be to use array_merge() or just assign the overriding values to the elements individually.

laryn commented 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?

quicksketch commented 2 years ago

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.

laryn commented 2 years ago

@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!