Closed (outdated)
Project:
Domain
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2012 at 19:01 UTC
Updated:
2 May 2025 at 13:03 UTC
Jump to comment: Most recent
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 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 commentedComment #4
agentrickardThanks!
Comment #5
bluegeek9 commentedDrupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.