Bug #25402
closedPHP Catchable Fatal Error: t3lib_iconWorks::mapRecordTypeToSpriteIconName()
100%
Description
The hook in line 865 passes an array to call a user function, but the method t3lib_div::callUserFunction needs a variable passed by reference. An easy fix is possible:
change line
$recordType6 = t3lib_div::callUserFunction($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['userFunc'], array('row' => $row), $ref);
to lines
$param = array('row' => $row);
$recordType6 = t3lib_div::callUserFunction($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['userFunc'], $param, $ref);
Stacktrace:
Fatal error: Cannot pass parameter 2 by reference in /usr/share/typo3/typo3_src-4.5.0/t3lib/class.t3lib_iconworks.php on line 853 Call Stack: 0.0035 655032 1. {main}() /usr/share/typo3/typo3_src-4.5.0/typo3/mod.php:0 0.2960 10854440 2. require('/usr/share/typo3/typo3_src-4.5.0/typo3/sysext/recordlist/mod1/index.php') /usr/share/typo3/typo3_src-4.5.0/typo3/mod.php:51 0.3188 12451960 3. SC_db_list->main() /usr/share/typo3/typo3_src-4.5.0/typo3/sysext/recordlist/mod1/index.php:514 0.3558 13210152 4. recordList->generateList() /usr/share/typo3/typo3_src-4.5.0/typo3/sysext/recordlist/mod1/index.php:310 0.4306 14338728 5. localRecordList->getTable() /usr/share/typo3/typo3_src-4.5.0/typo3/class.db_list.inc:303 0.4334 14379688 6. localRecordList->renderListRow() /usr/share/typo3/typo3_src-4.5.0/typo3/class.db_list_extra.inc:553 0.4337 14381744 7. t3lib_iconWorks::getSpriteIconForRecord() /usr/share/typo3/typo3_src-4.5.0/typo3/class.db_list_extra.inc:670 0.4339 14382864 8. t3lib_iconWorks::mapRecordTypeToSpriteIconClass() /usr/share/typo3/typo3_src-4.5.0/t3lib/class.t3lib_iconworks.php:764 0.4339 14382864 9. t3lib_iconWorks::mapRecordTypeToSpriteIconName() /usr/share/typo3/typo3_src-4.5.0/t3lib/class.t3lib_iconworks.php:791
(issue imported from #M18046)
Updated by Steffen Gebert over 13 years ago
Sven, can you provide an example how to reproduce this?
Review:
master: https://review.typo3.org/1290
Updated by Sven Luzar over 13 years ago
First create a plugin. Add the following class:
class tx_my_typeicon {
public function main($row, $ref){
return "test";
}
}
and register the class in tca.php:
$TCA['tt_content']['ctrl']['typeicon_classes']['userFunc'] = 'EXT:myext/class.tx_my_typeicon.php:tx_my_typeicon->main';
Updated by Mr. Hudson over 13 years ago
Patch set 4 of change I445ae05aa79913cb152da06cc66941db3fdf9227 has been pushed to the review server.
It is available at http://review.typo3.org/1290
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change Ib0c0b2bd504fdbc346e8f70009bb60e82a66d8b0 has been pushed to the review server.
It is available at http://review.typo3.org/1378
Updated by Mr. Hudson over 13 years ago
Patch set 5 of change I445ae05aa79913cb152da06cc66941db3fdf9227 has been pushed to the review server.
It is available at http://review.typo3.org/1290
Updated by Mr. Hudson over 13 years ago
Patch set 6 of change I445ae05aa79913cb152da06cc66941db3fdf9227 has been pushed to the review server.
It is available at http://review.typo3.org/1290
Updated by Mr. Hudson over 13 years ago
Patch set 2 of change Ib0c0b2bd504fdbc346e8f70009bb60e82a66d8b0 has been pushed to the review server.
It is available at http://review.typo3.org/1378
Updated by Sven Luzar over 13 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset 480296906a535bfe21c271654bd99b006c289c05.