Bug #69443

Fatal error in indexed search pibased plugin

Added by Tymoteusz Motylewski about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2015-08-31
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Fatal error: Call to a member function includeLLFile() on a non-object in indexed search pibased plugin after pull

It;s a regression caused by https://review.typo3.org/#/c/41592
because $GLOBALS['LANG'] doesn't exist in the frontend context (if be user is not logged in).


Related issues

Related to TYPO3 Core - Bug #68903: indexed_search plugin throws uncatchable fatal error if not logged in in backend Closed 2015-08-10

Associated revisions

Revision 81d7ce7c (diff)
Added by Tymoteusz Motylewski about 4 years ago

[BUGFIX] Fix loading of language file in indexed_search

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 <>
Tested-by: Alexander Opitz <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>

History

#1 Updated by Gerrit Code Review about 4 years ago

  • Status changed from New 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/42946

#2 Updated by Tymoteusz Motylewski about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#3 Updated by Vladimir Falcon about 4 years ago

I'm not sure but I think this Patch do not work, at least it did not work for me.

TYPO3 7.4.0

Problem:
File: typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
Function main ()
Line 185
$this->pi_loadLL('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf');

The function pi_loadLL does not takes any parameter.

The fatal error is gone but translation as well.

My solution:

Replace line 185 whit the following lines

/** @var $languageFactory \TYPO3\CMS\Core\Localization\LocalizationFactory */
$languageFactory = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LocalizationFactory::class);
$this->LOCAL_LANG = $languageFactory->getParsedData('EXT:indexed_search/Resources/Private/Language/locallang_pi.xlf',$this->LLkey);

Thanks you all

#4 Updated by Tymoteusz Motylewski about 4 years ago

Hi Vladimir

It looks like you're using new indexed search version on the old core.
Or have an xclass or AbstractPlugin, and haven't updated the loadLL method.

Since few weeks the pi_loadLL function takes an argument, see http://review.typo3.org/42934

It was implemented to solve problems like one with indexed search.
I'm not sure though if it was already released in 7.4 or not.

#5 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF