Bug #68903
closedindexed_search plugin throws uncatchable fatal error if not logged in in backend
0%
Description
Just updated to 7.4
If i open a page, that contains a plugin of type indexed_search it throws an error:
Fatal error: Call to a member function includeLLFile() on null in ...typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php on line 185
So it seems $GLOBALS['LANG'] is not set
If i am logged in in backend and preview the page it works. It seems like initializeLanguageObject never happens in FE context, but its just a shot in the dark.
Files
Updated by Philipp Wrann over 9 years ago
TYPO3\CMS\Frontend\Http\RequestHandler only loads the language object if the admPanel is loaded, so that explains my situation - but is that intended to be so? I think the $GLOBALS['LANG'] variable might be used in various extensions and scripts.
Updated by Susanne Moog over 9 years ago
- Is Regression changed from No to Yes
This sounds like a regression caused by https://review.typo3.org/#/c/41592/3 - thanks for finding it.
Updated by Philipp Wrann over 9 years ago
Is this going to be fixed soon? I am running 7.4 in one production environment :(
Updated by A. Sales over 9 years ago
- File getLanguageService.PNG getLanguageService.PNG added
Hello Philipp,
Maybe this fix will help you, I had the same problem. The fix works when logged out, but when logged in to the same browser, the front-end languages remain on the default language.
In SearchFormController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
Change this starting at line 2372:
protected function getLanguageService() {
return $GLOBALS['LANG'];
}
to this:
protected function getLanguageService() {
if (!is_object($GLOBALS['LANG'])) {
$GLOBALS['LANG'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Lang\LanguageService::class);
$GLOBALS['LANG']->init($GLOBALS['TSFE']->config['config']['language']);
}
return $GLOBALS['LANG'];
}
Updated by Morton Jonuschat about 9 years ago
- Status changed from New to Resolved
Resolved by #69443