[TASK] Quote database identifiers when used instead of globally upfront
The implementation of the bugfix https://review.typo3.org/53360 was done by iterating over TCA during cache generation and correctly quoting SQL fragments that are provided, to after that store TCA in cache. This has disadvantages: 1. A DB connection is required to create TCA cache: This makes efforts for warming up caches upfront impossible, as cache warmup should be able to be performed on build systems without DB connection. 2. It separates code that executes a query from code that is preparing a query: Escaping arguments for a query in a different place than the actual query execution can be considered an anti pattern, because at other points it isn't clear in which context these values are used. Beside that, performing the actual query, undoing DB encoding and redoing a different encoding is impossible. Pre-processing / quoting identifiers upfront can be considered a similar anti pattern as well. Despite there are less use cases to perform operations on the original non quoted identifiers, post processing of such fields in an event is impossible with the current implementation. 3. The current implementation being buggy and the adoption in TYPO3 is sparse: While this could be tackled with according fixes, it shows that this feature, that has been implemented a couple of years ago and is a technical burden, is rarely used, and therefore the implementation can be simplified and cleaned up. The patch drops this TCA preparation and field name escaping is now done in places where the queries are actually built. Strictly seen this is a breaking change for implementers of the TCA post processing event or for custom code that directly uses TCA to perform query parts. It is unlikely though that such code exists in userland, nonetheless a feature flag "runtimeDbQuotingOfTcaConfiguration" is introduced to allow extensions to also use the feature flag and use the quoting on demand if not done before. For TYPO3 v12, this feature flag will be enabled at all times. Releases: master Resolves: #94697 Change-Id: Ie0e48054def29c6c1e2810c8d30528c719439d9f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69507 Tested-by:Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Helmut Hummel <typo3@helhum.io> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Helmut Hummel <typo3@helhum.io>
Showing
- typo3/sysext/backend/Classes/Controller/Wizard/SuggestWizardController.php 9 additions, 2 deletions...end/Classes/Controller/Wizard/SuggestWizardController.php
- typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php 6 additions, 1 deletion...nd/Classes/Form/FormDataProvider/AbstractItemProvider.php
- typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php 11 additions, 4 deletions...3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 10 additions, 3 deletionstypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Classes/Database/RelationHandler.php 10 additions, 3 deletionstypo3/sysext/core/Classes/Database/RelationHandler.php
- typo3/sysext/core/Classes/Preparations/TcaPreparation.php 4 additions, 1 deletiontypo3/sysext/core/Classes/Preparations/TcaPreparation.php
- typo3/sysext/core/Configuration/DefaultConfiguration.php 1 addition, 0 deletionstypo3/sysext/core/Configuration/DefaultConfiguration.php
- typo3/sysext/core/Documentation/Changelog/master/Important-94697-QuoteDatabaseIdentifiersWhenUsedInsteadOfGloballyUpfront.rst 42 additions, 0 deletions...teDatabaseIdentifiersWhenUsedInsteadOfGloballyUpfront.rst
- typo3/sysext/core/Tests/Unit/Preparations/TcaPreparationTest.php 4 additions, 0 deletions...ysext/core/Tests/Unit/Preparations/TcaPreparationTest.php
- typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php 11 additions, 4 deletions...sext/recordlist/Classes/RecordList/DatabaseRecordList.php
Please register or sign in to comment