Project

General

Profile

Actions

Bug #25402

closed

PHP Catchable Fatal Error: t3lib_iconWorks::mapRecordTypeToSpriteIconName()

Added by Sven Luzar about 13 years ago. Updated over 5 years ago.

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

100%

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

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)

Actions #1

Updated by Steffen Gebert about 13 years ago

Sven, can you provide an example how to reproduce this?

Review:
master: https://review.typo3.org/1290

Actions #2

Updated by Sven Luzar about 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';

Actions #3

Updated by Steffen Gebert about 13 years ago

  • Target version deleted (0)
Actions #4

Updated by Mr. Hudson about 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

Actions #5

Updated by Mr. Hudson about 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

Actions #6

Updated by Mr. Hudson about 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

Actions #7

Updated by Mr. Hudson about 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

Actions #8

Updated by Mr. Hudson about 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

Actions #9

Updated by Sven Luzar about 13 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF