Task #88944

Cast or convert TCA array elements to bool, int or float (before write to cache)

Added by Daniel Windloff 3 months ago. Updated 3 months ago.

Status:
Under Review
Priority:
Should have
Category:
Code Cleanup
Target version:
-
Start date:
2019-08-10
Due date:
% Done:

0%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

As TCA is a php array, there is no type safety by default. If there is a need to use a value of the $GLOBALS['TCA'], there must be a type convert or cast before you can use it.
Type safety in general become more important in php especially after the introduction of type hints for scalar method parameters.

In order to force the use of the fitting type, the TCA values should be converted to the needed type via TcaMigration. It also allows informing extension developers how to adjust the used TCA.

The goal of this change is not to create a context sensitive validation of the given TCA configuration. It is meant to address common issues as pseudo booleans like 'exclude' => 1 or pseudo integer values like 'cols' => '40'.

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61484

#2 Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61484

Also available in: Atom PDF