Bug #27800
closedPassing "null" in t3lib_div::callUserFunction causes Fatal Error in tx_Workspaces_Service_Workspaces::viewSingleRecord
0%
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.
Updated by Michael Klapper over 13 years ago
In case you already have the record you could pass it to the hook. If you don't just try to pass a variable as follow:
$record=null; ->viewSingleRecord($table, $uid, $record)
Updated by Tolleiv Nietsch over 13 years ago
- Status changed from New to Needs Feedback
Updated by Tolleiv Nietsch about 13 years ago
Alexander - does this answer your question?
Updated by Mr. Jenkins about 13 years ago
Patch set 1 of change I4ea437116aecfbb4e28cc09c744aa552e7c6ae94 has been pushed to the review server.
It is available at http://review.typo3.org/6758
Updated by Stefan Neufeind about 13 years ago
- Status changed from Needs Feedback to Under Review
Updated by Mr. Jenkins about 13 years ago
Patch set 1 of change I4ea437116aecfbb4e28cc09c744aa552e7c6ae94 has been pushed to the review server.
It is available at http://review.typo3.org/6795
Updated by Mr. Jenkins about 13 years ago
Patch set 1 of change I579b28f6dc5390ba208cecbc745c0ae76a4f1711 has been pushed to the review server.
It is available at http://review.typo3.org/6796
Updated by Stefan Neufeind about 13 years ago
- Status changed from Under Review to Resolved
- Assignee set to Stefan Neufeind
Updated by Michael Stucki almost 11 years ago
- Project changed from 624 to TYPO3 Core
- Category changed from Workspaces to Workspaces