Skip to content

Commit 6e7441c

Browse files
authored
Import undefined variable (#7164)
* fix: Remove composer.lock * fix: Resolve issue with undefined variable input_string * fix: Change based upon Copilot recommendation
1 parent dcb00ce commit 6e7441c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

lib/import.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,6 +2259,11 @@ function xml_to_data_input_method($hash, &$xml_array, &$hash_cache) {
22592259
if (!$preview_only) {
22602260
$data_input_field_id = sql_save($save, 'data_input_fields');
22612261

2262+
/* update field use counter cache if possible */
2263+
if (isset($save['input_string']) && $save['input_string'] != '' && $data_input_id > 0) {
2264+
generate_data_input_field_sequences($save['input_string'], $data_input_id);
2265+
}
2266+
22622267
$hash_cache['data_input_field'][$parsed_hash['hash']] = $data_input_field_id;
22632268

22642269
update_replication_crc(0, 'poller_replicate_data_input_fields_crc');
@@ -2268,13 +2273,6 @@ function xml_to_data_input_method($hash, &$xml_array, &$hash_cache) {
22682273
}
22692274
}
22702275

2271-
/* update field use counter cache if possible */
2272-
if (!$preview_only) {
2273-
if ((isset($xml_array['input_string'])) && (!empty($data_input_id))) {
2274-
generate_data_input_field_sequences($save['input_string'], $data_input_id);
2275-
}
2276-
}
2277-
22782276
/* status information that will be presented to the user */
22792277
$import_debug_info['type'] = (empty($_data_input_id) ? 'new' : ($status > 0 ? 'updated':'unchanged'));
22802278
$import_debug_info['hash'] = $hash;

0 commit comments

Comments
 (0)