Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion conversions/call.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
10 changes: 9 additions & 1 deletion conversions/end.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down Expand Up @@ -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));";
}
Expand Down