Skip to content
Snippets Groups Projects
Commit ed48af4c authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#181195 by hunmonk and Pasqualle: node type related variables were not...

#181195 by hunmonk and Pasqualle: node type related variables were not properly renamed, when node type names changed
parent dde0923c
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -299,19 +299,20 @@ function node_type_form_submit($form, &$form_state) { ...@@ -299,19 +299,20 @@ function node_type_form_submit($form, &$form_state) {
// Save or reset persistent variable values. // Save or reset persistent variable values.
foreach ($variables as $key => $value) { 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')) { if ($op == t('Reset to defaults')) {
variable_del($key); variable_del($variable_old);
} }
else { else {
if (is_array($value)) { if (is_array($value)) {
$value = array_keys(array_filter($value)); $value = array_keys(array_filter($value));
} }
variable_set($key, $value); variable_set($variable_new, $value);
if ($type->old_type != $type->type) { if ($variable_new != $variable_old) {
$key = str_replace($type->type, $type->old_type, $key); variable_del($variable_old);
variable_del($key);
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment