Bug #103825
closedUndefined array key "foreign_table" in TcaInputPlaceholders
100%
Description
When you're using a select field as placeholder for a textfield in TCA, you get an Undefined array key "foreign_table" in TcaInputPlaceholders warning in PHP 8.
TCA:
$GLOBALS['TCA']['tt_content']['columns']['fieldname'] = [
'label' => 'Fieldlabel',
'config' => [
'type' => 'input',
'eval' => 'trim',
'placeholder' => '__row|CType',
],
];
Relevant Code-Position:
https://github.com/TYPO3/typo3/blob/2acd0592d211663ba3d29cb2aafe1344d04f9f0b/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInputPlaceholders.php#L123
switch ($fieldConfig['type']) {
case 'select':
case 'category':
// The FormDataProviders already resolved the select items to an array of uids,
// filter out empty values that occur when no related record has been selected.
$possibleUids = array_filter($value);
$foreignTableName = $fieldConfig['foreign_table'];
break;
It's not guaranteed, that the foreign_table key is set for all select types.
Updated by Gerrit Code Review 6 months ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84391
Updated by Gerrit Code Review 6 months ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84391
Updated by Gerrit Code Review 6 months ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84394
Updated by Gerrit Code Review 6 months ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84395
Updated by Georg Ringer 6 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a2d9e7dc24f92dae2f8194316499d9d206355990.