Domain settings not saved for forms with #tree set to true

Created on 23 March 2012, about 13 years ago
Updated 2 May 2025, about 1 month ago

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.

πŸ› Bug report
Status

Closed: outdated

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium freblasty

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024