SQLite Migration Error

Avatar of biggyboss92
Posts 6 46

Error Message Alert:
Échec de la migration : Array (English please?)

image.png

Avatar of Fred
Posts 493 2238

1.1.6 — 2026-07-28

Fixed

  • Failed migrations showed "Échec de la migration : Array" instead of the real error — reported on flatboard.org thread #190. StorageMigratorController::step() built the failure message with implode('; ', array_slice($report['errors'] ?? [], 0, 3)), but each entry of $report['errors'] (pushed by JsonToSqliteMigration/SqliteToJsonMigration) is an associative array (type/entity_id/username or name/message), never a string — PHP silently casts each array to the literal string "Array" instead of erroring, so with the common case of a single logged error, implode() on that one-element array returned exactly "Array" and the actual exception message (e.g. a SQLite constraint violation) never reached the admin. The error entries are now mapped to "{message} ({context})" (falling back to type when no message, and to username/name/entity_id for context) before being imploded. Verified end-to-end with a forced-failure migration run against a stubbed JSON target: the old code reproduced the exact reported "Array; Array" output, the new code surfaces the real constraint message in all 6 locales.
  • Every admin-facing message in the controller was hardcoded in French regardless of locale — found while fixing the above (unknown step, invalid target type, storage already using X, insufficient disk space, pdo_sqlite missing, SQLite requires Pro, invalid storage type, migration successful/failed, the generic exception wrapper, and both CSRF-error responses). All now go through Translator::trans(); new keys added to the 6 locale files, the two CSRF messages reuse the existing core errors.security.csrfInvalid key.
    Files changed: StorageMigratorController.php, langs/{fr,en,de,pt,zh,pl}.json.

You can try new version of this plugin here:
Premium

Edited on  Jul 29, 2026  By  Fred .

Navigation
2 Posts
post #1
28 Jul 2026
By Utilisateur
Statistics
191
Discussions
1,029
Replies
26
Flatboarders
2
Contributors
New member : biggyboss92
Online
15 Guests online