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.
Domain settings are not saved for setting forms that have #tree set to true:
function some_module_settings_form() {
$form = array('#tree' => TRUE);
// Some form elements.
return system_settings_form($form);
}
This problem can be resolved with a minor change to the domain_settings_form_submit()-handler:
// Original retrieval of the domain id:
$domain_id = $form_state['values']['domain_id'];
// Fix:
$domain_id = empty($form['#tree']) ? $form_state['values']['domain_id'] : $form_state['values']['domain_settings']['domain_id'];
I included a patch which contains the above fix.
Comment | File | Size | Author |
---|---|---|---|
domain-settings-not-saved.patch | 793 bytes | freblasty |
Comments
Comment #1
agentrickardDo you have Ann example form that you can point to for testing the patch.
Comment #2
freblasty CreditAttribution: freblasty commentedFollowing form is an existing form which is used to configure our proxy settings:
To fully test to above form checkout my sandbox which contains the module named webclient_proxy: http://drupal.org/sandbox/daeron/1490922
Comment #3
freblasty CreditAttribution: freblasty commentedComment #4
agentrickardThanks!