fix: DatabaseImporter silently continues on SQL execution errors #188

Open
opened 2026-06-29 14:41:12 +00:00 by jmiller · 2 comments
Owner

Summary

DatabaseImporter.php catches SQL execution errors in the import loop and logs them but continues to the next statement. A partially-imported database is left in an inconsistent state with no clear indication to the user that the import was incomplete.

Location

source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php

Fix

  • Track error count and report in the final result
  • Optionally support a "stop on error" mode
  • At minimum, set the restore status to warning (not complete) if any statements failed
## Summary `DatabaseImporter.php` catches SQL execution errors in the import loop and logs them but continues to the next statement. A partially-imported database is left in an inconsistent state with no clear indication to the user that the import was incomplete. ## Location `source/packages/com_mokosuitebackup/src/Engine/DatabaseImporter.php` ## Fix - Track error count and report in the final result - Optionally support a "stop on error" mode - At minimum, set the restore status to `warning` (not `complete`) if any statements failed
jmiller added the component: engine label 2026-06-29 14:41:12 +00:00
Author
Owner

Branch created: feature/188-fix-databaseimporter-silently-continues-

git fetch origin
git checkout feature/188-fix-databaseimporter-silently-continues-
Branch created: [`feature/188-fix-databaseimporter-silently-continues-`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteBackup/src/branch/feature/188-fix-databaseimporter-silently-continues-) ```bash git fetch origin git checkout feature/188-fix-databaseimporter-silently-continues- ```
Author
Owner

Confirmed in 02.56.05 — keep open.

DatabaseImporter::import() still swallows errors: the catch at DatabaseImporter.php:97-102 (and the tail-statement path at :116-118) only calls error_log(...) and continues. The method returns just $statementsExecuted (:124) with no failure count, no stop-on-error mode, and no way to surface a warning restore status. None of the three requested remediations are implemented.

Confirmed in 02.56.05 — keep open. `DatabaseImporter::import()` still swallows errors: the catch at `DatabaseImporter.php:97-102` (and the tail-statement path at `:116-118`) only calls `error_log(...)` and continues. The method returns just `$statementsExecuted` (`:124`) with no failure count, no stop-on-error mode, and no way to surface a warning restore status. None of the three requested remediations are implemented.
Sign in to join this conversation.