Actions
Bug #27800
closedPassing "null" in t3lib_div::callUserFunction causes Fatal Error in tx_Workspaces_Service_Workspaces::viewSingleRecord
Start date:
2011-07-01
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
After using the hook ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord']) in the viewSingleRecord method in class tx_Workspaces_Service_Workspaces I received the following error:
"Cannot pass parameter 3 by reference in /srv/www/typo3_src-4.5.3/typo3/sysext/workspaces/Classes/Service/Workspaces.php on line 516"
As you can see the 3rd parameter in t3lib_div::callUserFunction is null:
public static function viewSingleRecord($table, $uid, $record=null) {
$viewUrl = '';
debug($viewUrl);
if ($table == 'pages') {
$viewUrl = t3lib_BEfunc::viewOnClick(t3lib_BEfunc::getLiveVersionIdOfRecord('pages', $uid));
} elseif ($table 'pages_language_overlay' || $table 'tt_content') {
$elementRecord = is_array($record) ? $record : t3lib_BEfunc::getLiveVersionOfRecord($table, $uid);
$viewUrl = t3lib_BEfunc::viewOnClick($elementRecord['pid']);
} else {
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'])) {
$_params = array('table' => $table, 'uid' => $uid, 'record' => $record);
$_funcRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['workspaces']['viewSingleRecord'];
$viewUrl = t3lib_div::callUserFunction($_funcRef, $_params, null);
}
}
return $viewUrl;
}
After removing 3rd parameter null and simply passing only $_funcRef and $_params it worked fine.
Actions