Bug #72113
closed
Invalid argument warning in backend sysext
Added by A. Sheydin almost 9 years ago.
Updated almost 9 years ago.
Category:
FormEngine aka TCEforms
Description
In TYPO3 7.6.0 and tt_products 2.8.1 I got the following PHP Warning:
#1: PHP Warning: Invalid argument supplied for foreach() in /homepages/46/d289040129/htdocs/yellow-head.de/typo3_src-7.6.0/typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php line 194 (More information)
TYPO3\CMS\Core\Error\Exception thrown in file
/homepages/46/d289040129/htdocs/yellow-head.de/typo3_src-7.6.0/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111.
[…]
which was fixed by Franz Holzinger, the tt_products author in the backend sysext as follows:
typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php Line 194
if (!empty($possibleRecords)) {
foreach ($possibleRecords as $possibleRecord) {
$possibleRecordsUidToTitle[$possibleRecord[1]] = $possibleRecord[0];
}
}
Please apply in the next release. Thank you.
Files
- Category changed from Backend User Interface to FormEngine aka TCEforms
- Status changed from New to Needs Feedback
- Assignee set to Christian Kuhn
Same for line 539 in InlineControlContainer.php
foreach ($possibleRecords as $p) {
if (!in_array($p[1], $uniqueIds)) {
$opt[] = '<option value="' . htmlspecialchars($p[1]) . '">' . htmlspecialchars($p[0]) . '</option>';
}
}
changed to:
if (!empty($possibleRecords)) {
foreach ($possibleRecords as $p) {
if (!in_array($p[1], $uniqueIds)) {
$opt[] = '<option value="' . htmlspecialchars($p[1]) . '">' . htmlspecialchars($p[0]) . '</option>';
}
}
}
- Status changed from Needs Feedback to Rejected
- Assignee deleted (
Christian Kuhn)
Hey.
Setting TCA from / within ext_tables was discouraged with 6.2 already and migration of non-clean TCA for core version 7 only if ext:compatibility6 is loaded, which in turn results in a significant performance loss!
So, this is still an issue with tt_product and not in core. The extension should finally put its TCA definition out of ext_tables.php and to Configuration/TCA or Configuration/TCA/Overrides AND set the renderType for type=select TCA fields. The core PHP warning will vanish, then. This was mentioned in https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/7.3/Deprecation-67229-TcaChanges.html#impact together with an explanation of other TCA changes.
Also available in: Atom
PDF