From ed48af4c411b9199b947b6887fba34550be5aa20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Sat, 22 Dec 2007 23:21:54 +0000 Subject: #181195 by hunmonk and Pasqualle: node type related variables were not properly renamed, when node type names changed --- modules/node/content_types.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'modules') 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); } } } -- cgit v1.2.3