Skip to content

Commit 1996dcd

Browse files
committed
Merge pull request TYPO3-extensions#5 from jacobsenj/master
[BUGFIX] Do not show frequent search terms from other languages or sites in a multisite environment
1 parent 356bb00 commit 1996dcd

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

PiResults/FrequentSearchesCommand.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,16 @@ protected function getFrequentSearchTerms() {
148148
$terms = array();
149149

150150
// Use configuration as cache identifier
151-
$identifier = 'frequentSearchesTags_' . md5(serialize($this->configuration['search.']['frequentSearches.']));
151+
$identifier = 'frequentSearchesTags';
152+
153+
if ($this->configuration['search.']['frequentSearches.']['select.']['checkRootPageId']) {
154+
$identifier.= '_RP' . (int)$GLOBALS['TSFE']->tmpl->rootLine[0]['uid'];
155+
}
156+
if ($this->configuration['search.']['frequentSearches.']['select.']['checkLanguage']) {
157+
$identifier.= '_L' . (int)$GLOBALS['TSFE']->sys_language_uid;
158+
}
159+
160+
$identifier.= '_' . md5(serialize($this->configuration['search.']['frequentSearches.']));
152161

153162
if ($this->cacheInstance->has($identifier)) {
154163
$terms = $this->cacheInstance->get($identifier);

0 commit comments

Comments
 (0)