With the recent patches, the xmlsitemap module is working great for my site.

One thing that I do think should change is that the Default Base URL also be exported as configuration.
Currently, the Label does export correctly but the URL does not. Upon re-importing the xmlsitemap configuration on a fresh database, everything but the Base URL is imported.

Feature Request: Add ability to export Default Base URL as configuration.

Comments

jonnyeom created an issue. See original summary.

slucero’s picture

It appears that currently the base url is being explicitly excluded from config export and is being saved in state instead.

From XmlSitemapSettingsForm::submitForm()

    $this->state->set('xmlsitemap_developer_mode', $values['xmlsitemap_developer_mode']);
    $this->state->set('xmlsitemap_base_url', $values['xmlsitemap_base_url']);

    unset($values['xmlsitemap_developer_mode']);
    unset($values['xmlsitemap_base_url']);

This seems to be related to the conversation and changes introduced in #2767647: Consider moving non-constant configuration values for specific sitemap instances out of config., but I'm not actually seeing anything there specifically referencing the base URL.

An argument could be made either way for this to be included or not, but since the value can be environment-specific a better handling for this might be to make the field behave as an override for the default site base URL value and make the settings field optional instead. In this case the logic for loading it elsewhere may need to be updated, but any override value provided would also need to be exported to config.