Fix to stop processing queries on error

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2024-04-06 22:51:14 +02:00
parent 60be3d9510
commit f33afab939
2 changed files with 10 additions and 1 deletions

View File

@ -252,10 +252,15 @@ class Import
unset($sqlData['valid_full']);
for ($i = 0; $i < $count; $i++) {
$this->executeQuery($queries[$i], $fulls[$i], $sqlData);
if ($GLOBALS['error']) {
break;
}
}
}
$this->executeQuery($import_run_buffer['sql'], $import_run_buffer['full'], $sqlData);
if (! $GLOBALS['error']) {
$this->executeQuery($import_run_buffer['sql'], $import_run_buffer['full'], $sqlData);
}
}
} elseif (! empty($import_run_buffer['full'])) {
if ($go_sql) {

View File

@ -161,6 +161,10 @@ class ImportSql extends ImportPlugin
$this->import->runQuery($statement, $statement, $sql_data);
}
if ($GLOBALS['error']) {
return;
}
// Finishing.
$this->import->runQuery('', '', $sql_data);
}