diff --git a/conversions/call.inc b/conversions/call.inc index 22aca4f..8e44dae 100644 --- a/conversions/call.inc +++ b/conversions/call.inc @@ -65,7 +65,11 @@ function coder_upgrade_upgrade_call_variable_get_alter(&$node, &$reader) { // DO } elseif ($item->printParameter(1)) { $value = str_replace("'", '', $item->printParameter(1)); - if (preg_match('@[\.\s\$\[\]\#\>\(]@', $value)) { + // Catch initialization with empty array. + if ($value == 'array()') { + $value = array(); + } + elseif (preg_match('@[\.\s\$\[\]\#\>\(]@', $value)) { $value = 'dynamic value in file ' . $path . ' line ' . $node->line; } } diff --git a/conversions/end.inc b/conversions/end.inc index d36986f..8faa0d0 100644 --- a/conversions/end.inc +++ b/conversions/end.inc @@ -281,6 +281,10 @@ function coder_upgrade_create_update_install($module_name, &$reader, &$nodes, $c $line_matches = array(); foreach ($config_data as $key => $line) { + if ($line == array()) { + // Catch initialization with empty array. + continue; + } if (preg_match('/(dynamic variable in file )(.*)/', $line, $matches) || preg_match('/(dynamic value in file )(.*)/', $line, $matches)) { $line_matches[] = $matches[2]; } @@ -359,7 +363,11 @@ function coder_upgrade_create_update_1000($module_name, &$reader, &$nodes, $conf $body->insertLast($body_content); foreach ($config_data as $key => $line) { - if (is_bool($line)) { + if ($line == array()) { + // Check initialization with empty array. + $string = " \$config->set('$key', update_variable_get('$key', array()));"; + elseif (is_bool($line)) { + // Check initialization with a Boolean variable $line = $line ? 'TRUE' : 'FALSE'; $string = " \$config->set('$key', update_variable_get('$key', $line));"; }