diff --git a/Build/sites/main/config.yaml b/Build/sites/main/config.yaml index d1ac6bcd..84aee01b 100644 --- a/Build/sites/main/config.yaml +++ b/Build/sites/main/config.yaml @@ -59,6 +59,19 @@ languages: fallbacks: '1' flag: ch languageId: '3' + - title: English-Free + enabled: true + base: /en-free/ + typo3Language: default + locale: en_US.utf8 + iso-639-1: en + navigationTitle: EN + hreflang: en-US + direction: ltr + fallbackType: free + fallbacks: '0' + flag: gb + languageId: '4' rootPageId: 1 routes: { } websiteTitle: 'Testing' diff --git a/Classes/DataProcessing/ContainerProcessor.php b/Classes/DataProcessing/ContainerProcessor.php index 437c8de3..0380221d 100644 --- a/Classes/DataProcessing/ContainerProcessor.php +++ b/Classes/DataProcessing/ContainerProcessor.php @@ -16,6 +16,7 @@ use B13\Container\Domain\Factory\PageView\Frontend\ContainerFactory; use B13\Container\Domain\Model\Container; use Psr\Http\Message\ServerRequestInterface; +use TYPO3\CMS\Core\Context\LanguageAspect; use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor; @@ -113,9 +114,11 @@ protected function processColPos( $conf = [ 'tables' => 'tt_content', ]; + /** @var LanguageAspect $languageAspect */ + $languageAspect = $cObj->getTypoScriptFrontendController()->getContext()->getAspect('language'); foreach ($children as &$child) { if (!isset($processorConfiguration['skipRenderingChildContent']) || (int)$processorConfiguration['skipRenderingChildContent'] === 0) { - if ($child['l18n_parent'] > 0) { + if ($child['l18n_parent'] > 0 && $languageAspect->doOverlays()) { $conf['source'] = $child['l18n_parent']; } else { $conf['source'] = $child['uid']; diff --git a/Tests/Functional/Frontend/Fixtures/SiteLanguageFree/setup.csv b/Tests/Functional/Frontend/Fixtures/SiteLanguageFree/setup.csv new file mode 100644 index 00000000..f6133402 --- /dev/null +++ b/Tests/Functional/Frontend/Fixtures/SiteLanguageFree/setup.csv @@ -0,0 +1,10 @@ +"pages" +,"uid","pid","title","slug","sys_language_uid","l10n_parent","l10n_source" +,1,0,"page-1","/",0,0,0 +,2,0,"page-1-language-4","/",4,1,1 +"tt_content" +,"uid","pid","CType","header","sys_language_uid","colPos","tx_container_parent","l18n_parent","l10n_source" +,1,1,"b13-2cols-with-header-container","container-default",0,0,0,0,0 +,2,1,"header","header-default",0,200,1,0,0 +,3,1,"b13-2cols-with-header-container","container-translated",4,0,0,1,1 +,4,1,"header","header-translated",4,200,1,2,2 \ No newline at end of file diff --git a/Tests/Functional/Frontend/SiteLanguageFreeTest.php b/Tests/Functional/Frontend/SiteLanguageFreeTest.php new file mode 100644 index 00000000..3a618fc2 --- /dev/null +++ b/Tests/Functional/Frontend/SiteLanguageFreeTest.php @@ -0,0 +1,42 @@ +importCSVDataSet(__DIR__ . '/Fixtures/SiteLanguageFree/setup.csv'); + $this->setUpFrontendRootPage( + 1, + [ + 'constants' => ['EXT:container/Tests/Functional/Frontend/Fixtures/TypoScript/constants.typoscript'], + 'setup' => ['EXT:container/Tests/Functional/Frontend/Fixtures/TypoScript/setup.typoscript'], + ] + ); + } + + /** + * @test + * @group frontend + */ + public function containerTranslatedInFreeModeSiteConfiguration(): void + { + $response = $this->executeFrontendRequestWrapper(new InternalRequest('http://localhost/en-free')); + $body = (string)$response->getBody(); + $body = $this->prepareContent($body); + self::assertStringNotContainsString('

header-default

', $body); + self::assertStringContainsString('

header-translated

', $body); + } +}