[BUGFIX] Fix PHP Catchable Fatal Error in t3lib_iconWorks
authorSven Luzar <sven.luzar@gmx.de>
Mon, 28 Mar 2011 11:03:02 +0000 (13:03 +0200)
committerOliver Hader <oliver@typo3.org>
Thu, 31 Mar 2011 22:24:44 +0000 (00:24 +0200)
The hook in t3lib_iconWorks::mapRecordTypeToSpriteIconName() passes an
array to call a user function, but the method t3lib_div::callUserFunction
expects a variable being passed by reference.

Assigning the array to a variable fixes this error.

Thanks to Haymo Meran (Gentics) for sponsoring this fix with 80 beers
at the bug auction at T3BOARD11.

Change-Id: I445ae05aa79913cb152da06cc66941db3fdf9227
Resolves: #25402
Reviewed-on: http://review.typo3.org/1290
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/class.t3lib_iconworks.php

index 5d82883..541bec4 100644 (file)
@@ -861,7 +861,12 @@ final class t3lib_iconWorks {
                                        $recordType[5] = str_replace('###TYPE###', $row[$column], $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['mask']);
                                }
                                if (isset($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['userFunc'])) {
-                                       $recordType[6] = t3lib_div::callUserFunction($GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['userFunc'], array('row' => $row), $ref);
+                                       $parameters = array('row' => $row);
+                                       $recordType[6] = t3lib_div::callUserFunction(
+                                               $GLOBALS['TCA'][$table]['ctrl']['typeicon_classes']['userFunc'],
+                                               $parameters,
+                                               $ref
+                                       );
                                }
                        } else {
                                foreach ($recordType AS $key => $type) {