Bug #63896
closed
class.tslib_fe: Call to a member function getUrlToCurrentLocation() after Update to TYPO3 4.5.39
Added by König David over 9 years ago.
Updated over 5 years ago.
Description
In a Multidomain TYPO3 we have the folowing Error:
Fatal error: Call to a member function getUrlToCurrentLocation() on a non-object in [..]/typo3_src-4.5.39/typo3/sysext/cms/tslib/class.tslib_fe.php on line 4408
On non Multidomain Installation we dont have this Problem.
Also it Ocures not if you are loggedin in Backend, or the first time after clearing cache.
The Securty-Fix has the folowing changes:
From:
$scriptPath = $GLOBALS['TSFE']->absRefPrefix . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
To:
if (!$this->beUserLogin) {
$scriptPath = $this->cObj->getUrlToCurrentLocation();
} else {
// To break less existing sites, we allow the REQUEST_URI to be used for the prefix
$scriptPath = t3lib_div::getIndpEnv('REQUEST_URI');
// Disable the cache so that these URI will not be the ones to be cached
$this->disableCache();
}
- Status changed from New to Needs Feedback
Please specify your prefixLocalAnchors configuration
Are there any non cacheable elements on the page (USER_INT, COA_INT)?
Thanks for the fast answer,
My settings:
config.prefixLocalAnchors = output
I changed now to "all" and it works.
- Status changed from Needs Feedback to Accepted
König David wrote:
Thanks for the fast answer,
My settings:
config.prefixLocalAnchors = output
I changed now to "all" and it works.
Thanks for the feedback. Obviously we need to instantiate a cObject if this is set to output.
We've got the same error in TYPO3 6.2.9.
The reason is, if pages are cached, that the method TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->newCObj() is not triggered. Without $this->cObj the call of method getUrlToCurrentLocation() fails, of course.
A solution, which worked for us temporary, is to add the call to index_ts.php file (after line 238) manually:
if ($TSFE->isOutputting()) {
$TT->push('Print Content', ''); // this is line 238
$TSFE->newCObj(); // this line fixes the issue
$TSFE->processOutput();
$sendTSFEContent = TRUE;
$TT->pull();
}
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35989
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36029
Patch set 1 for branch TYPO3_4-5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36030
- Status changed from Under Review to Resolved
- Status changed from Resolved to Closed
Also available in: Atom
PDF