From e27e1a0e0df1e070d8172921461b815317f4bfaa Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 26 Jun 2010 21:32:20 +0000 Subject: - Patch #266246 by sun, effulgentsia, marcingy: remove smart defaults for system_settings_form(). --- modules/system/system.module | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index d187cc4ce..7ebd8004b 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2573,32 +2573,11 @@ function system_default_region($theme) { return isset($regions[0]) ? $regions[0] : ''; } -function _system_settings_form_automatic_defaults($form) { - // Get an array of all non-property keys - $keys = element_children($form); - - foreach ($keys as $key) { - // If the property (key) '#default_value' exists, replace it. - if (array_key_exists('#default_value', $form[$key])) { - $form[$key]['#default_value'] = variable_get($key, $form[$key]['#default_value']); - } - else { - // Recurse through child elements - $form[$key] = _system_settings_form_automatic_defaults($form[$key]); - } - } - - return $form; -} - /** * Add default buttons to a form and set its prefix. * * @param $form * An associative array containing the structure of the form. - * @param $automatic_defaults - * Automatically load the saved values for each field from the system variables - * (defaults to TRUE). * * @return * The form structure. @@ -2606,14 +2585,10 @@ function _system_settings_form_automatic_defaults($form) { * @see system_settings_form_submit() * @ingroup forms */ -function system_settings_form($form, $automatic_defaults = TRUE) { +function system_settings_form($form) { $form['actions']['#type'] = 'actions'; $form['actions']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration')); - if ($automatic_defaults) { - $form = _system_settings_form_automatic_defaults($form); - } - if (!empty($_POST) && form_get_errors()) { drupal_set_message(t('The settings have not been saved because of the errors.'), 'error'); } -- cgit v1.2.3