Skip to content

Commit

Permalink
[TASK] #3375: prepend wrong fe language on empty cache,
Browse files Browse the repository at this point in the history
use a clone of context on indexing to encapsulate the index from cli
process
  • Loading branch information
goldi42 authored and dkd-kaehm committed Nov 1, 2022
1 parent dd95174 commit 1426ef7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Classes/Domain/Site/SiteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use ApacheSolrForTypo3\Solr\System\Configuration\ExtensionConfiguration;
use ApacheSolrForTypo3\Solr\System\Records\Pages\PagesRepository;
use ApacheSolrForTypo3\Solr\System\Util\SiteUtility;
use ApacheSolrForTypo3\Solr\Util;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
use TYPO3\CMS\Core\Registry;
Expand Down Expand Up @@ -262,7 +263,7 @@ protected function validateRootPageRecord($rootPageId, $rootPageRecord)
*/
protected function buildTypo3ManagedSite(array $rootPageRecord): ?Typo3ManagedSite
{
$solrConfiguration = $this->frontendEnvironment->getSolrConfigurationFromPageId($rootPageRecord['uid']);
$solrConfiguration = $this->frontendEnvironment->getSolrConfigurationFromPageId($rootPageRecord['uid'], Util::getLanguageUid());
/** @var \TYPO3\CMS\Core\Site\Entity\Site $typo3Site */
try {
$typo3Site = $this->siteFinder->getSiteByPageId($rootPageRecord['uid']);
Expand Down
2 changes: 1 addition & 1 deletion Classes/IndexQueue/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ protected function getItemRecordOverlayed(Item $item, int $language): ?array
if ($language > 0) {
// @TODO Information from the site configuration are required!
/* @var Context $context */
$context = GeneralUtility::makeInstance(Context::class);
$context = clone GeneralUtility::makeInstance(Context::class);
/* @var LanguageAspect $languageAspect */
if ($context->hasAspect('language')) {
$languageAspect = $context->getAspect('language');
Expand Down

0 comments on commit 1426ef7

Please sign in to comment.