Project

General

Profile

Actions

Bug #75271

closed

TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() throws an exception in some cases

Added by Petra Arentzen about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-03-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #76232: IconFactory::getIconForRecord() throws an exception in some cases (contrary to former feedback)ClosedPetra Arentzen2016-05-18

Actions
Actions #1

Updated by Frank Nägler almost 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Frank Nägler
Actions #2

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.

Actions #3

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 :-)

Actions #4

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.

Actions

Also available in: Atom PDF