Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
53372323
Commit
53372323
authored
Dec 23, 2006
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#104575
by pwolanin and kkaefer: cleanup variables before saving.
parent
0a0aa9e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
modules/node/content_types.inc
modules/node/content_types.inc
+6
-4
No files found.
modules/node/content_types.inc
View file @
53372323
...
...
@@ -284,18 +284,20 @@ function node_type_form_submit($form_id, $form_values) {
$status
=
node_type_save
(
$type
);
$variables
=
$form_values
;
// Remove everything that's been saved already - whatever's left is assumed
// to be a persistent variable.
foreach
(
$
form_valu
es
as
$key
=>
$value
)
{
foreach
(
$
variabl
es
as
$key
=>
$value
)
{
if
(
isset
(
$type
->
$key
))
{
unset
(
$
form_valu
es
[
$key
]);
unset
(
$
variabl
es
[
$key
]);
}
}
unset
(
$
form_values
[
'type_display'
],
$form_values
[
'old_type'
],
$form_values
[
'orig_type'
],
$form_valu
es
[
'submit'
],
$
form_valu
es
[
'delete'
],
$
form_valu
es
[
'reset'
],
$
form_valu
es
[
'form_id'
]);
unset
(
$
variables
[
'form_token'
],
$variables
[
'op'
],
$variabl
es
[
'submit'
],
$
variabl
es
[
'delete'
],
$
variabl
es
[
'reset'
],
$
variabl
es
[
'form_id'
]);
// Save or reset persistent variable values.
foreach
(
$
form_valu
es
as
$key
=>
$value
)
{
foreach
(
$
variabl
es
as
$key
=>
$value
)
{
$key
.
=
'_'
.
$type
->
type
;
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