Project

General

Profile

Actions

Bug #102904

closed

IRRE exception if child record has not foreign_table

Added by Franz Holzinger 10 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2024-01-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
irre
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

When I create a child record for an IRRE element of the parent table, then an exception is thrown.

*'Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1476107295: PHP Warning: Undefined array key "foreign_table" in /var/www/html/develop12/dev12/vendor/typo3/cms-backend/Classes/Controller/FormInlineAjaxController.php line 123 *

https://github.com/franzholz/party/blob/master/Configuration/TCA/tx_party_parties.php

When a new electronic_address_identifier is generated, then the child table tx_party_electronic_address_identifier_usages is used for this. The TCA of this child table is

'electronic_address_identifier' => [
'exclude' => 1,
'label' => 'LLL:EXT:party/Resources/Private/Language/locallang_db.xlf:tx_party_electronic_address_identifier_usages.electronic_address_identifier',
'config' => [
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tx_party_electronic_address_identifiers',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'default' => 0,
],

According to the docs there is no requirement for a 'foreign_table' for a type = 'group'.

See

https://docs.typo3.org/m/typo3/reference-tca/12.4/en-us/ColumnsConfig/Type/Group/Properties/ForeignTable.html

Actions #1

Updated by Franz Holzinger 10 months ago

It will work if you add these lines after the if statement to the file vendor/typo3/cms-backend/Classes/Controller/FormInlineAjaxController.php **

if (($parentConfig['foreign_selector'] ?? false) && 
($parentConfig['appearance']['useCombination'] ?? false)
) {
if (empty($childData['processedTca']['columns'][$parentConfig['foreign_selector']]['config']['foreign_table'])) {
$childData['processedTca']['columns'][$parentConfig['foreign_selector']]['config']['foreign_table'] = $childData['processedTca']['columns'][$parentConfig['foreign_selector']]['config']['allowed'];
}
Actions #2

Updated by Gerrit Code Review 10 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/+/82721

Actions #3

Updated by Gerrit Code Review 10 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/+/82721

Actions #4

Updated by Gerrit Code Review 10 months ago

Patch set 3 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/+/82721

Actions #5

Updated by Gerrit Code Review 10 months ago

Patch set 4 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/+/82721

Actions #6

Updated by Gerrit Code Review 10 months ago

Patch set 5 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/+/82721

Actions #7

Updated by Gerrit Code Review 10 months ago

Patch set 6 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/+/82721

Actions #8

Updated by Gerrit Code Review 9 months ago

Patch set 7 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/+/82721

Actions #9

Updated by Gerrit Code Review 9 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/+/82994

Actions #10

Updated by Oliver Bartsch 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF