[BUGFIX] DefaultTcaSchema must not create SQL for tables not requested
The DefaultTcaSchema::enrich() function dynamically adds TCA-defined ctrl-fields to the SQL schema definition for a provided set of tables. The function used to add these definition for any table that is defined in TCA, independent whether the table actually exists in any ext_tables.sql file. While this behaviour is no problem under the assumption that the function is always called with the content of all ext_tables.sql files, this is a problem if the function is called with only a subset of those ext_tables.sql files. One example is the "extension manager tables" upgrade in the Install Tool. Despite the fact that the function was documented that it needs to be called with the full set of tables, it actually is not strictly necessary to do so. This patch changes the requirement for the enrich() function and changes the behaviour to not dynamically create tables if those are found in TCA. Technical detail to the reported bug: The table definitions created by this class are usually overruled by whatever might be defined in an ext_tables.sql file. In case of the upgrade wizard (where only extension manager tables are requested) the table definitions for all TCA tables were created based on the best practice suggestions from the core. If the present DB schema (created by the real ext_tables.sql files) mismatched those suggested definitions a DB schema change was proposed, hence the wizard kept popping up. Resolves: #89535 Releases: master, 9.5 Change-Id: I78594f1ee0878e8d3f5606901d0abb7fe0023059 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62154 Tested-by:TYPO3com <noreply@typo3.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Daniel Goerz <daniel.goerz@posteo.de> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Daniel Goerz <daniel.goerz@posteo.de>
Showing
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php 8 additions, 15 deletions.../sysext/core/Classes/Database/Schema/DefaultTcaSchema.php
- typo3/sysext/core/Tests/Unit/Database/Schema/DefaultTcaSchemaSqliteTest.php 42 additions, 36 deletions...Tests/Unit/Database/Schema/DefaultTcaSchemaSqliteTest.php
- typo3/sysext/core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php 43 additions, 37 deletions.../core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php
Please register or sign in to comment