Open jurajsulek opened 4 years ago
I had the same problem, and debugged it. The main problem in Solr 11.2.0 is that the plugin is calling the Site resolver and TypoScript resolving without handing in the language. I fixed it with this patch.
diff -ru Classes/FrontendEnvironment/TypoScript.php Classes/FrontendEnvironment/TypoScript.php
--- Classes/FrontendEnvironment/TypoScript.php 2022-02-03 11:36:51.000000000 +0100
+++ Classes/FrontendEnvironment/TypoScript.php 2022-08-18 00:27:30.000000000 +0200
@@ -29,9 +29,16 @@
* @param int $language System language uid, optional, defaults to 0
* @return TypoScriptConfiguration The Solr configuration for the requested tree.
*/
- public function getConfigurationFromPageId($pageId, $path, $language = 0)
+ public function getConfigurationFromPageId($pageId, $path, $language = null)
{
$pageId = $this->getConfigurationPageIdToUse($pageId);
+ if ($language === null) {
+ if ($GLOBALS['TSFE'] && $GLOBALS['TSFE']->getLanguage()) {
+ $language = $GLOBALS['TSFE']->getLanguage()->getLanguageId();
+ } else {
+ $language = 0;
+ }
+ }
$cacheId = md5($pageId . '|' . $path . '|' . $language);
if (isset($this->configurationObjectCache[$cacheId])) {
diff -ru Classes/FrontendEnvironment.php Classes/FrontendEnvironment.php
--- Classes/FrontendEnvironment.php 2022-02-03 11:36:51.000000000 +0100
+++ Classes/FrontendEnvironment.php 2022-08-18 00:27:08.000000000 +0200
@@ -92,7 +92,7 @@
* @param ?int $language
* @return TypoScriptConfiguration
*/
- public function getConfigurationFromPageId($pageId, $path = '', $language = 0): TypoScriptConfiguration
+ public function getConfigurationFromPageId($pageId, $path = '', $language = null): TypoScriptConfiguration
{
return $this->typoScript->getConfigurationFromPageId($pageId, $path, $language);
}
@@ -119,8 +119,8 @@
* @param ?int $language
* @return TypoScriptConfiguration
*/
- public function getSolrConfigurationFromPageId($pageId, $language = 0): TypoScriptConfiguration
+ public function getSolrConfigurationFromPageId($pageId, $language = null): TypoScriptConfiguration
{
return $this->getConfigurationFromPageId($pageId, '', $language);
}
-}
\ No newline at end of file
+}
We have on some pages in header