Commit 3300aa2d authored by Gerhard Killesreiter's avatar Gerhard Killesreiter

#59960, Can't store the value of submit, patch by Zen

parent 9e9e0e2c
......@@ -176,8 +176,6 @@ function drupal_validate_form($form_id, $form, $callback = NULL) {
function drupal_submit_form($form_id, $form, $callback = NULL) {
global $form_values;
$default_args = array($form_id, &$form_values);
// Prevent system module forms (system/theme settings) from saving certain form fields to the variables table.
unset($GLOBALS['form_values']['submit'], $GLOBALS['form_values']['reset'], $GLOBALS['form_values']['form_id']);
if (isset($form['#submit'])) {
foreach ($form['#submit'] as $function => $args) {
......
......@@ -760,6 +760,9 @@ function system_theme_settings_submit($form_id, $values) {
$op = isset($_POST['op']) ? $_POST['op'] : '';
$key = $values['var'];
// Exclude unnecessary elements.
unset($values['var'], $values['submit'], $values['reset'], $values['form_id']);
if ($op == t('Reset to defaults')) {
variable_del($key);
drupal_set_message(t('The configuration options have been reset to their default values.'));
......@@ -786,6 +789,9 @@ function system_settings_form_submit($form_id, $values) {
$values['clean_url'] = 0;
}
// Exclude unnecessary elements.
unset($values['submit'], $values['reset'], $values['form_id']);
foreach ($values as $key => $value) {
if ($op == t('Reset to defaults')) {
variable_del($key);
......
......@@ -760,6 +760,9 @@ function system_theme_settings_submit($form_id, $values) {
$op = isset($_POST['op']) ? $_POST['op'] : '';
$key = $values['var'];
// Exclude unnecessary elements.
unset($values['var'], $values['submit'], $values['reset'], $values['form_id']);
if ($op == t('Reset to defaults')) {
variable_del($key);
drupal_set_message(t('The configuration options have been reset to their default values.'));
......@@ -786,6 +789,9 @@ function system_settings_form_submit($form_id, $values) {
$values['clean_url'] = 0;
}
// Exclude unnecessary elements.
unset($values['submit'], $values['reset'], $values['form_id']);
foreach ($values as $key => $value) {
if ($op == t('Reset to defaults')) {
variable_del($key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment