#104963 Undefined array key 0 exception in FullRecordContainer
Description
The opening of IRRE records ends in an Exception:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1476107295: PHP Warning: Undefined array key 0 in /path/typo3_src-13.2.1.test/typo3/sysext/backend/Classes/Form/Container/FullRecordContainer.php line 47 | TYPO3\CMS\Core\Error\Exception thrown in file /path/typo3_src-13.2.1.test/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 138. Requested URL: https://demo13.website.com/typo3/ajax/record/inline/details?token=—AnonymizedToken—Reviews 2
Files 2
History 1416
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-09-13T16:16:29+00:00" > 09/13/24, 16:16 </span> -
Franz Holzinger commented and changed attached Product-Article-Relation-IRRE.png <span data-processor="relativetime" data-value="2024-09-13T18:29:53+00:00" > 09/13/24, 18:29 </span>
You can reproduce this in tt_products. Create a product and some articles inside of the IRRE relation of the product.
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2024-09-13T18:49:06+00:00" > 09/13/24, 18:49 </span>
Thanks for the feedback. If you are able to provide a smaller, isolated example at some point, we might be able to help. tt_products is too big and loaded with dependencies we cannot properly debug within reasonable time.
-
Stefan Bürk commented <span data-processor="relativetime" data-value="2024-09-13T19:03:17+00:00" > 09/13/24, 19:03 </span>
I guess we could here add an early check if the expolded array does not contain any elements:
$fieldsArray = GeneralUtility::trimExplode(',', $itemList, true); // add here a $fieldsArray === [] check and return early - or ensure that handling below is guarded properly // Streamline the fields array // First, make sure there is always a --div-- definition for the first element if (!str_starts_with($fieldsArray[0], '--div--')) { array_unshift($fieldsArray, '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general');Thanks for reportng this. Not sure how this occured or can be reproduced, but guarding that make sense I guess.
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2024-09-14T18:08:50+00:00" > 09/14/24, 18:08 </span>
Unsure about this. The rest of the method really expects that fieldArray contains information. The method returns something vital which an ‘early return’ IMO would break.
This kind of sounds to me like a TCA misconfiguration issue. I think we need an EXT:styleguide reproducible example for it first.
-
Stefan Bürk commented <span data-processor="relativetime" data-value="2024-09-15T04:14:36+00:00" > 09/15/24, 04:14 </span>
Garvin Hicking wrote in #note-5:
> Unsure about this. The rest of the method really expects that fieldArray contains information. The method returns something vital which an ‘early return’ IMO would break.
>
> This kind of sounds to me like a TCA misconfiguration issue. I think we need an EXT:styleguide reproducible example for it first.ack. should not investigate such things laying tired on hells floor – being there now again ;)
@franzholz
Could you please fully dump / save the content of $this->data before the `if (!str_starts_with(….` when $fieldArray is an empty array ?
Something like
$fieldsArray = GeneralUtility::trimExplode(',', $itemList, true); //-------------------------------------- file_put_contents( \TYPO3\CMS\Core\Core\Environment::getVarPath() . '/empty-field-array-in-full-record-container.json', \json_encode($this->data, JSON_PRETTY_PRINT), ); //-------------------------------------- if (!str_starts_with($fieldsArray[0], '--div--')) { -
Franz Holzinger commented and changed attached empty-field-array-in-full-record-container.json <span data-processor="relativetime" data-value="2024-09-30T16:22:43+00:00" > 09/30/24, 16:22 </span>
This error also happens in TYPO3 12.
-
Benni Mack commented <span data-processor="relativetime" data-value="2024-10-07T12:19:57+00:00" > 10/07/24, 12:19 </span>
Hey Franz,
you can actually fix this by using this configuration in your parent table when defining the type=inline:
‘appearance’ => [
‘collapseAll’ => 1,
]if you don’t have any visible fields in your child table, then collapseAll should be sufficient
-
Franz Holzinger commented <span data-processor="relativetime" data-value="2024-10-07T16:39:14+00:00" > 10/07/24, 16:39 </span>
@benni :
I have tried it out:
‘article_uid’ => [
‘exclude’ => 1,
‘label’ => ‘LLL:EXT:’ . $extensionKey . $languageSubpath . ‘locallang_db.xlf:’ . $table . ‘.article_uid’,
‘config’ => [
‘type’ => ‘inline’,
‘appearance’ => [
‘collapseAll’ => true,
// ‘newRecordLinkAddTitle’ => true,
// ‘useCombination’ => true,
],
‘foreign_table’ => ‘tt_products_products_mm_articles’,
‘foreign_field’ => ‘uid_local’,
‘foreign_sortby’ => ‘sorting’,
‘foreign_label’ => ‘uid_foreign’,
‘foreign_selector’ => ‘uid_foreign’,
‘foreign_unique’ => ‘uid_foreign’,
‘maxitems’ => 1000,
‘default’ => 0,
],
],No difference. There is still the same error message.
-
Franz Holzinger commented <span data-processor="relativetime" data-value="2024-10-18T18:39:26+00:00" > 10/18/24, 18:39 </span>
This commit fixes this issue.
-
Benni Mack commented <span data-processor="relativetime" data-value="2024-10-19T19:54:02+00:00" > 10/19/24, 19:54 </span>
Thanks, I suggest closing this ticket now, and actually adding some information to docs.typo3.org that showitem should include at least one field. OK?
-
Franz Holzinger commented <span data-processor="relativetime" data-value="2024-10-19T20:01:57+00:00" > 10/19/24, 20:01 </span>
It would be more helpful if TYPO3 could warn about this (log file or somewhere else) or even throw an exception in such a case like this one.
-
Gerrit Code Review pushed patch set 3 for main to change 86806 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2024-10-31T09:49:23+00:00" > 10/31/24, 09:49 </span> -
Gerrit Code Review pushed patch set 1 for 13.4 to change 86862 <span data-processor="relativetime" data-value="2024-11-04T09:02:43+00:00" > 11/04/24, 09:02 </span>
-
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2024-11-04T09:20:08+00:00" > 11/04/24, 09:20 </span>Applied in changeset commit:4cd861c5220b7734161f61d1fd2f8ec8fd3e4ab0.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:33:29+00:00" > 12/02/25, 14:33 </span>
Thanks for the report!
Can you please provide a minimal example to reproduce this, mabye using EXT:styleguide as an example? What do I need to click where to reproduce it?