Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
3300aa2d
Commit
3300aa2d
authored
Apr 25, 2006
by
Gerhard Killesreiter
Browse files
#59960
, Can't store the value of submit, patch by Zen
parent
9e9e0e2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/form.inc
View file @
3300aa2d
...
...
@@ -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
)
{
...
...
modules/system.module
View file @
3300aa2d
...
...
@@ -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
);
...
...
modules/system/system.module
View file @
3300aa2d
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment