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.
Problem/Motivation
The form should not use overridden config, because this means the override will be saved to the database when submitting the form.
Steps to reproduce
Add this to settings.php
$config['simple_sitemap.settings']['base_url'] = 'https://' . $main_host;
Browse to /admin/config/search/simplesitemap/settings
.
The overridden URL is displayed in the form field.
Proposed resolution
Use ConfigFactory::getEditable()
to load the config.
Issue fork simple_sitemap-3359679
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
prudloff CreditAttribution: prudloff at Insite for Muséum national d'Histoire naturelle commentedComment #4
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedYour reasoning makes sense but I wonder if you know of any other places (like core) known to do it your way? Also we'd have to scan the whole code base including submodules if this change is to be accepted.
Comment #5
prudloff CreditAttribution: prudloff at Insite for Muséum national d'Histoire naturelle commentedIt is explained here.
The core uses it for example in
GDToolkit::buildConfigurationForm()
or inThemeExperimentalConfirmForm
.#2910353: Prevent saving config entities when configuration overrides are applied also talks about preventing saving the configuration when it contains overrides.
Comment #6
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedThis makes sense. I'm happy to merge this as soon as all forms are taken under account (including submodules). Feel free to grab it!
Comment #8
elberHi I just rebased please revise.
Comment #10
gbyte CreditAttribution: gbyte as a volunteer and at gbyte commentedCommited to dev. Thank you!