diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-22 23:21:54 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-22 23:21:54 +0000 |
commit | ed48af4c411b9199b947b6887fba34550be5aa20 (patch) | |
tree | df16be56affafd21c234cefdd7c72a2257b99218 /modules | |
parent | dde0923ce5a916e6f2e0cfff1ef1f6bcf7ada48d (diff) | |
download | brdo-ed48af4c411b9199b947b6887fba34550be5aa20.tar.gz brdo-ed48af4c411b9199b947b6887fba34550be5aa20.tar.bz2 |
#181195 by hunmonk and Pasqualle: node type related variables were not properly renamed, when node type names changed
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node/content_types.inc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index e813a3b5e..c58a32ab0 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -299,19 +299,20 @@ function node_type_form_submit($form, &$form_state) { // Save or reset persistent variable values. foreach ($variables as $key => $value) { - $key .= '_'. $type->type; + $variable_new = $key .'_'. $type->type; + $variable_old = $key .'_'. $type->old_type; + if ($op == t('Reset to defaults')) { - variable_del($key); + variable_del($variable_old); } else { if (is_array($value)) { $value = array_keys(array_filter($value)); } - variable_set($key, $value); + variable_set($variable_new, $value); - if ($type->old_type != $type->type) { - $key = str_replace($type->type, $type->old_type, $key); - variable_del($key); + if ($variable_new != $variable_old) { + variable_del($variable_old); } } } |