Project

General

Profile

Actions

Bug #27800

closed

Passing "null" in t3lib_div::callUserFunction causes Fatal Error in tx_Workspaces_Service_Workspaces::viewSingleRecord

Added by Alexander Menzel over 13 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Workspaces
Target version:
-
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 #1

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)

Actions #2

Updated by Tolleiv Nietsch over 13 years ago

  • Status changed from New to Needs Feedback
Actions #3

Updated by Tolleiv Nietsch about 13 years ago

Alexander - does this answer your question?

Actions #4

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

Actions #5

Updated by Stefan Neufeind about 13 years ago

  • Status changed from Needs Feedback to Under Review
Actions #6

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

Actions #7

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

Actions #8

Updated by Stefan Neufeind about 13 years ago

  • Status changed from Under Review to Resolved
  • Assignee set to Stefan Neufeind
Actions #9

Updated by Michael Stucki almost 11 years ago

  • Category set to Workspaces
Actions #10

Updated by Michael Stucki almost 11 years ago

  • Project changed from 624 to TYPO3 Core
  • Category changed from Workspaces to Workspaces
Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF