Project

General

Profile

Actions

Bug #68903

closed

indexed_search plugin throws uncatchable fatal error if not logged in in backend

Added by Philipp Wrann over 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Indexed Search
Target version:
Start date:
2015-08-10
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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

getLanguageService.PNG (25.8 KB) getLanguageService.PNG A. Sales, 2015-08-18 11:41

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #69443: Fatal error in indexed search pibased pluginClosedTymoteusz Motylewski2015-08-31

Actions
Actions #1

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.

Actions #2

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.

Actions #3

Updated by Philipp Wrann over 9 years ago

Is this going to be fixed soon? I am running 7.4 in one production environment :(

Actions #4

Updated by A. Sales over 9 years ago

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'];
}
Actions #5

Updated by Morton Jonuschat about 9 years ago

  • Status changed from New to Resolved

Resolved by #69443

Actions #6

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF