Move clean up earlier

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2024-04-06 17:42:27 +02:00
parent e447622a3d
commit b8dd3a4f09
2 changed files with 7 additions and 12 deletions

View File

@ -682,6 +682,13 @@ final class ImportController extends AbstractController
return null;
}
if ($request->hasBodyParam('rollback_query')) {
// We rollback because there might be other queries that need to be executed after this,
// e.g. creation of a bookmark.
$this->dbi->query('ROLLBACK');
ImportSettings::$message .= __('[ROLLBACK occurred.]');
}
if ($GLOBALS['result']) {
// Save a Bookmark with more than one queries (if Bookmark label given).
if (! empty($request->getParsedBodyParam('bkm_label')) && ! empty($GLOBALS['import_text'])) {
@ -711,11 +718,6 @@ final class ImportController extends AbstractController
include ROOT_PATH . $GLOBALS['goto'];
}
// If there is request for ROLLBACK in the end.
if ($request->hasBodyParam('rollback_query')) {
$this->dbi->query('ROLLBACK');
}
return null;
}
}

View File

@ -240,13 +240,6 @@ class Import
// Do we have something to push into buffer?
$this->importRunBuffer = $sql !== '' ? $sql . ';' : null;
// In case of ROLLBACK, notify the user.
if (! isset($_POST['rollback_query'])) {
return;
}
ImportSettings::$message .= __('[ROLLBACK occurred.]');
}
/**