Issue Bug Needs Feedback

#111515FinisherTranslationLanguageUpgradeWizard passes an array to Connection::update() for form_definition

Aristeidis Karavas 11/20/26, 09:13 updated 11/20/26, 13:45

Description

The upgrade wizard `formFinisherTranslationLanguageMigration`, introduced with 1(https://forge.typo3.org/issues/87675) in TYPO3 14.3.12, fails when migrating form definitions stored in the database (`form_definition`).

The wizard passes an array directly to the database connection instead of JSON-encoding it before updating the `configuration` column.

Steps to reproduce

1. Install TYPO3 14.3.12.
2. Create a record in `form_definition` containing an email finisher with `options.translation.language` set to a translated label, e.g. `Standard` (as stored by the form editor before #87675).
3. Run the upgrade wizard:

vendor/bin/typo3 upgrade:run formFinisherTranslationLanguageMigration

Actual behavior

With `E_WARNING` included in `exceptionalErrors`, the upgrade wizard aborts after migrating the form plugins. Database-stored form definitions are not migrated.

Exception:

[ TYPO3\CMS\Core\Error\Exception ]
PHP Warning: Array to string conversion in
vendor/doctrine/dbal/src/Driver/Mysqli/Statement.php line 73

Without `E_WARNING` in `exceptionalErrors`, PHP converts the array to the string `“Array”`, which could subsequently be written to the `configuration` column (not tested).

Expected behavior

Database-stored form definitions should be migrated successfully, with the updated configuration serialized as JSON before being persisted.

Root cause

In `Classes/Upgrades/FinisherTranslationLanguageUpgradeWizard.php`:

Line 224 – `migrateFormDefinition()`

The method returns `?array` using:

return $this->jsonObjectKeyOrderPreserver->protect($formDefinition);

Line 113 – `executeUpdate()`

The returned array is passed directly to the database connection:

$connection->update(
    'form_definition',
    ['configuration' => $migratedConfiguration],
    // ...
)

However, `FormDefinitionRepository` (line 187) explicitly JSON-encodes the same structure before persisting it:

json_encode(
    $this->jsonObjectKeyOrderPreserver->protect(...),
    JSON_THROW_ON_ERROR
)

The upgrade wizard omits this serialization step, causing Doctrine DBAL to receive an array where a string is expected.

Suggested fix

JSON-encode the migrated configuration before passing it to the database connection:

[
    'configuration' => json_encode(
        $migratedConfiguration,
        JSON_THROW_ON_ERROR
    ),
]

This aligns the upgrade wizard’s persistence behavior with `FormDefinitionRepository` and prevents the array-to-string conversion warning.

## Environment

- TYPO3 version: 14.3.12
- Component: EXT:form
- Affected wizard: `formFinisherTranslationLanguageMigration`
- Affected table: `form_definition`
- Database driver: MySQLi / Doctrine DBAL
- Regression reference: #87675

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] FinisherTranslationLanguageUpgradeWizard passes an array to Connection::update() for form_definition Resolves: #111515 Releases: main

History 4

  1. Josua Vogel commented <span data-processor="relativetime" data-value="2026-11-20T13:44:53+00:00" > 11/20/26, 13:44 </span>

    Thanks for the detailed report. I could reproduce the warning, but only when
    @form_definition.configuration@ is not detected as a JSON column. On a freshly set up
    schema, the wizard works on MySQL 8.0/8.4, MariaDB 10.4/10.11/11.8, PostgreSQL and SQLite.
    To find out why your column is different, could you please provide:

    1. The database server and version: SELECT VERSION();
    2. The table definition: SHOW CREATE TABLE form_definition;
    3. The CHECK constraints of the table (MariaDB only):
    SELECT CONSTRAINT_NAME, CHECK_CLAUSE
      FROM information_schema.CHECK_CONSTRAINTS
     WHERE CONSTRAINT_SCHEMA = DATABASE() AND TABLE_NAME = 'form_definition';
    1. The history of this database: was it ever restored from a dump, moved from MySQL to
      MariaDB (or the other way round), or changed with tools like pt-online-schema-change
      or gh-ost? Was the column changed by hand?
    2. Does “Admin Tools > Maintenance > Analyze Database Structure” offer any change for
      form_definition?
    3. Does the wizard still fail after “Flush TYPO3 and PHP Cache”?