Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the code for the hook url alter options we can't override base url. I think we need to add an extra condition to check if we are overriding the base url in the hook.
For example with a multisite with multiple domains. I created a context per domain and then I need to say a domain per context but I can't override because always use the same. I attach a patch for fix this problem.
Comment | File | Size | Author |
---|---|---|---|
allow_alter_base_url.patch | 774 bytes | fastangel | |
Comments
Comment #2
pifagorYou have to enable patch testing
Comment #3
pifagorThis patch didn't passed the tests. you need to work on the patch
Comment #4
pawel_r CreditAttribution: pawel_r commentedI had problem after moving from test to production server: base_url was always as test it was on test server. There is no good solution (at the moment) besides changing state value:
\Drupal::state()->set('xmlsitemap_base_url','PRODUCTION BASE URL');
Waiting for proper patch.
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedCan I set xmlsitemap_base_url variable via the local settings form like this
$settings['xmlsitemap_base_url']
?Comment #6
Arrow@SocialNicheGuru You can with the patch in #2999856: Allow Override of Base URL in settings.php
Comment #7
vuilThank you, @Arrow. Yes, you are right. I added the mentioned issue as "related".
Comment #8
alex_optimWe have the same issue https://www.drupal.org/project/xmlsitemap/issues/2905963
Comment #9
pifagorYes @alex_optim right
Comment #10
pifagor