summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--modules/system/system.admin.inc11
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 3cc01b702..6f1ca3a3c 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.16, xxxx-xx-xx (development version)
-----------------------
+- Fixed the theme settings form to properly clean up submitted values in
+ $form_state['values'] when the form is submitted (data structure change).
- Updated various admin tables to use the default "empty table" text UX
pattern.
- Added proxy server support to drupal_http_request().
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 23a975b0c..c9d623ca9 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -691,8 +691,16 @@ function _system_theme_settings_validate_path($path) {
* Process system_theme_settings form submissions.
*/
function system_theme_settings_submit($form, &$form_state) {
+ // Exclude unnecessary elements before saving.
+ form_state_values_clean($form_state);
+
$values = $form_state['values'];
+ // Extract the name of the theme from the submitted form values, then remove
+ // it from the array so that it is not saved as part of the variable.
+ $key = $values['var'];
+ unset($values['var']);
+
// If the user uploaded a new logo or favicon, save it to a permanent location
// and use it in place of the default theme-provided file.
if ($file = $values['logo_upload']) {
@@ -722,10 +730,7 @@ function system_theme_settings_submit($form, &$form_state) {
if (empty($values['default_favicon']) && !empty($values['favicon_path'])) {
$values['favicon_mimetype'] = file_get_mimetype($values['favicon_path']);
}
- $key = $values['var'];
- // Exclude unnecessary elements before saving.
- unset($values['var'], $values['submit'], $values['reset'], $values['form_id'], $values['op'], $values['form_build_id'], $values['form_token']);
variable_set($key, $values);
drupal_set_message(t('The configuration options have been saved.'));