Bug #75271
closedTYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() throws an exception in some cases
0%
Description
TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() throws an exception about wrong parameter-type for second argument which is NULL but should be an array, if 'internal_type' is 'DB' and "prepend_tname" is set to false in TCA-FieldConf
In that case a fallback is done:
src/typo3_src/typo3/sysext/backend/Classes/Form/Element/GroupElement.php:276 - 291
foreach ($temp_itemArray as $dbRead) { $recordParts = explode('|', $dbRead); list($this_table, $this_uid) = BackendUtility::splitTable_Uid($recordParts[0]); // For the case that no table was found and only a single table is defined to be allowed, use that one: if (!$this_table && $onlySingleTableAllowed) { $this_table = $allowed; } $itemArray[] = array('table' => $this_table, 'id' => $this_uid); if (!$disabled && $show_thumbs) { $rr = BackendUtility::getRecordWSOL($this_table, $this_uid); $thumbnails[] = array( 'name' => BackendUtility::getRecordTitle($this_table, $rr, true), 'image' => $this->iconFactory->getIconForRecord($this_table, $rr, Icon::SIZE_SMALL)->render(), 'path' => BackendUtility::getRecordPath($rr['pid'], $perms_clause, 15), 'uid' => $rr['uid'], 'table' => $this_table ); } }
I think this must be changed:
if (!$this_table && $onlySingleTableAllowed) { $this_table = $allowed; }
if (!$this_table && $onlySingleTableAllowed) { $this_table = reset($allowed); }
Otherwise $rr is set to NULL and the Exception is thrown.
Also perhaps always the case where record is not found should be handled?
Updated by Frank Nägler almost 8 years ago
- Status changed from New to Accepted
- Assignee set to Frank Nägler
Updated by Frank Nägler almost 8 years ago
- Status changed from Accepted to Needs Feedback
Hi Petra,
the code you mentioned are not available in 7.6 or master.
Can you please test the issue with latest 7.6 release and CMS 8 master?
I can't reproduce the issue. If this is still an issue, please provide more information, like a complete TCA setup, exact TYPO3 version and PHP version.
thank you for your help.
Updated by Petra Arentzen almost 8 years ago
I also can't reproduce now more. Error seems to be gone since 7.6.x, so issue may be closed.
Thanks for checking :-)
Updated by Riccardo De Contardi almost 8 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Frank Nägler)
Closed.
Thank you for your feedback.