[BUGFIX] Fix loading of language file in indexed_search 46/42946/2
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 31 Aug 2015 16:16:59 +0000 (18:16 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 1 Sep 2015 15:34:40 +0000 (17:34 +0200)
As $GLOBALS['LANG'] doesn't exist in the frontend context,
language (xlf) file has to be loaded through pi_loadLL.

Resolves: #69443
Releases: master
Change-Id: I7668acc3b899fe89e5aaf1a1cdb09dc7a36053e2
Reviewed-on: http://review.typo3.org/42946
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php

index d99b628..4fcb63b 100755 (executable)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\IndexedSearch\Controller;
 
 use TYPO3\CMS\Core\Html\HtmlParser;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Lang\LanguageService;
 
 /**
  * Index search frontend
@@ -182,7 +181,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function main($content, $conf) {
                // Initialize:
                $this->conf = $conf;
-               $this->LOCAL_LANG = $this->getLanguageService()->includeLLFile('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf' , FALSE, TRUE);
+               $this->pi_loadLL('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf');
                $this->pi_setPiVarDefaults();
                // Initialize:
                $this->initialize();
@@ -2364,12 +2363,4 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
        public function getJoinPagesForQuery() {
                return (bool)$this->join_pages;
        }
-
-       /**
-        * Returns the Language Service
-        * @return LanguageService
-        */
-       protected function getLanguageService() {
-               return $GLOBALS['LANG'];
-       }
 }