Important: The FlexForm upgrade wizard migrates records
Description
The upgrade wizard academic
(FGTCLB\) never migrated a
single content element. It built the WHERE constraint of its UPDATE
statement on the query builder of the enclosing SELECT:
$updateQueryBuilder->update('tt_content')
->set('pi_flexform', $this->array2xml($flexFormData))
->where(
$queryBuilder->expr()->in( // select builder
'uid',
$queryBuilder->createNamedParameter($record['uid'], …) // select builder
)
)
->executeStatement();
A named parameter is bound to the query builder that created it, so the
statement carried a placeholder whose value was never bound to it — while
set had created a placeholder of its own on the update builder, holding the
new FlexForm XML. The first record therefore ran
UPDATE tt_content SET pi_flexform = :dcValue1 WHERE uid IN (:dcValue1)
comparing the XML against uid, and every following record referred to a
placeholder that did not exist on the update builder at all.
The constraint is now built on the builder that executes it, with eq since
the value is always a single uid:
->where(
$updateQueryBuilder->expr()->eq(
'uid',
$updateQueryBuilder->createNamedParameter($record['uid'], Connection::PARAM_INT)
)
)
Impact
The wizard now performs the FlexForm migration it announces:
settings. becomes settings. (value 1 maps
to active, anything else to all), settings. becomes
settings. and settings. becomes
settings., each keeping its value.
Previously the outcome depended on the database:
- MySQL, MariaDB and SQLite reported success and changed nothing.
- PostgreSQL aborted with a
Doctrine\, invalid input syntax for integer.DBAL\ Exception\ Driver Exception
Affected Installations
Installations that ran the upgrade wizard of a previous version. The plugin
FlexForm of academicprojects_ and
academicprojects_ content elements still carries the old
setting names, and the plugins fall back to their default behaviour for those
settings.
Migration
Run the upgrade wizard again. An installation that already executed it has it recorded as done, so it has to be marked undone first — in the Install Tool under Upgrade > Upgrade Wizard, or on the command line:
vendor/bin/typo3 upgrade:mark:undone academicProjects_flexFormUpgradeWizard
vendor/bin/typo3 upgrade:run academicProjects_flexFormUpgradeWizard
Running it again is safe: the wizard only rewrites a FlexForm that still contains one of the old setting names and leaves every other record untouched.