diff --git a/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php b/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php index b36212876e05d3cee11c27339a11e51ffa254a8d..0c088268372bf97fb08ec0200008db71a1599bd4 100644 --- a/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php +++ b/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php @@ -17,16 +17,14 @@ namespace TYPO3\CMS\Backend\Tests\Functional\Controller\Page; */ use TYPO3\CMS\Backend\Controller\Page\LocalizationController; -use TYPO3\CMS\Core\Core\Bootstrap; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\Http\ServerRequest; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService; +use TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase; /** * Test case for TYPO3\CMS\Backend\Controller\Page\LocalizationController */ -class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase +class LocalizationControllerTest extends AbstractDataHandlerActionTestCase { /** * @var string @@ -38,11 +36,6 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional */ protected $subject; - /** - * @var \TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService - */ - protected $actionService; - /** * @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication */ @@ -60,15 +53,11 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional { parent::setUp(); - $this->backendUser = $this->setUpBackendUserFromFixture(1); - $this->backendUser->workspace = 0; - - Bootstrap::initializeLanguageObject(); - $this->actionService = GeneralUtility::makeInstance(ActionService::class); - $this->importDataSet(__DIR__ . '/Fixtures/pages.xml'); $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/sys_language.xml'); $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/backend/Tests/Functional/Controller/Page/Fixtures/tt_content-default-language.xml'); + $this->setUpFrontendRootPage(1); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->subject = $this->getMockBuilder(LocalizationController::class) ->setMethods(['getPageColumns']) @@ -305,14 +294,4 @@ class LocalizationControllerTest extends \TYPO3\TestingFramework\Core\Functional return $recordLocalizeSummary['records']; } - - /** - * @param string $dataSetName - */ - protected function assertAssertionDataSet(string $dataSetName) - { - $fileName = rtrim($this->assertionDataSetDirectory, '/') . '/' . $dataSetName . '.csv'; - $fileName = GeneralUtility::getFileAbsFileName($fileName); - $this->assertCSVDataSet($fileName); - } } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php index 418535832e4bc25f6969967229be0963ec3e70e4..605607ce346990e4f07d78cc07339c575e30ce5c 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php @@ -14,6 +14,8 @@ namespace TYPO3\CMS\Core\Tests\Functional\DataHandling; * The TYPO3 project - inspiring people to share! */ +use Symfony\Component\Yaml\Yaml; +use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Context\WorkspaceAspect; use TYPO3\CMS\Core\Core\Bootstrap; @@ -80,6 +82,37 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase */ protected $backendUser; + /** + * Default Site Configuration + * @var array + */ + protected $siteLanguageConfiguration = [ + 1 => [ + 'title' => 'Dansk', + 'enabled' => true, + 'languageId' => 1, + 'base' => '/dk/', + 'typo3Language' => 'dk', + 'locale' => 'da_DK.UTF-8', + 'iso-639-1' => 'da', + 'flag' => 'dk', + 'fallbackType' => 'fallback', + 'fallbacks' => '0' + ], + 2 => [ + 'title' => 'Deutsch', + 'enabled' => true, + 'languageId' => 2, + 'base' => '/de/', + 'typo3Language' => 'de', + 'locale' => 'de_DE.UTF-8', + 'iso-639-1' => 'de', + 'flag' => 'de', + 'fallbackType' => 'fallback', + 'fallbacks' => '1,0' + ], + ]; + protected function setUp(): void { parent::setUp(); @@ -100,6 +133,49 @@ abstract class AbstractDataHandlerActionTestCase extends FunctionalTestCase parent::tearDown(); } + /** + * Create a simple site config for the tests that + * call a frontend page. + * + * @param int $pageId + * @param array $additionalLanguages + */ + protected function setUpFrontendSite(int $pageId, array $additionalLanguages = []) + { + $languages = [ + 0 => [ + 'title' => 'English', + 'enabled' => true, + 'languageId' => 0, + 'base' => '/', + 'typo3Language' => 'default', + 'locale' => 'en_US.UTF-8', + 'iso-639-1' => 'en', + 'navigationTitle' => '', + 'hreflang' => '', + 'direction' => '', + 'flag' => 'us', + ] + ]; + $languages = array_merge($languages, $additionalLanguages); + $configuration = [ + 'rootPageId' => $pageId, + 'base' => '/', + 'languages' => $languages, + 'errorHandling' => [], + 'routes' => [], + ]; + GeneralUtility::mkdir_deep($this->instancePath . '/typo3conf/sites/testing/'); + $yamlFileContents = Yaml::dump($configuration, 99, 2); + $fileName = $this->instancePath . '/typo3conf/sites/testing/config.yaml'; + GeneralUtility::writeFile($fileName, $yamlFileContents); + // Ensure that no other site configuration was cached before + $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_core'); + if ($cache->has('site-configuration')) { + $cache->remove('site-configuration'); + } + } + /** * @param int $workspaceId */ diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/FAL/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/FAL/AbstractActionTestCase.php index 74165b0809baebff21081e1a27af7972cf1cd95d..e7e256a3b3dac34dd62f581f6475b54dfa0fa0a3 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/FAL/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/FAL/AbstractActionTestCase.php @@ -54,6 +54,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultElements'); $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/sys_file_storage.xml'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php index 674a9d46d91a3c4d0986863572d4179e91c123c6..04bbec6191b4c28c6f3fccdf8a277cb60a9f39a1 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php @@ -86,13 +86,14 @@ class ActionTest extends AbstractActionTestCase */ public function copyContentToLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguage(); $this->assertAssertionDataSet('copyContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[1]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #2')); @@ -108,6 +109,8 @@ class ActionTest extends AbstractActionTestCase */ public function localizeContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->assertAssertionDataSet('localizeContent'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php index d7ec994a88223be193adb606c93d1bf3bed89001..1c7d3b199b0985cd26d015208d4f3201d7390d7b 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Group/AbstractActionTestCase.php @@ -48,6 +48,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultElements'); $this->importScenarioDataSet('ReferenceIndex'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/ActionTest.php index 88ee453ff8c99117eddd37bbaf6f750fabe717b8..bdccf2cc7572995832858f97783912894afa90f5 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/ActionTest.php @@ -241,13 +241,16 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Abs */ public function copyContentToLanguageOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguageOfRelation(); $this->assertAssertionDataSet('copyContentToLanguageOfRelation'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentElement) @@ -322,6 +325,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Abs */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/copyContentToLanguageOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/copyContentToLanguageOfRelation.csv index 22e60929228549ae59508bd700a231566ef89fdf..ca4765ea1053c922590216a9b48dbcdbd5210f88 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/copyContentToLanguageOfRelation.csv +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/copyContentToLanguageOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group" ,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv index d4d8e58ea1a41fca558fa8c56bea093c68b9e269..f70ff3df5b1133a3cea176193fc0815f99e16cf3 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group" ,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php index 41e1a0e292d43320f87fefcddc71438a8dd3dcf0..6e7620f61d58793a7e1bf795ba9ce39b94c25b62 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/AbstractActionTestCase.php @@ -50,6 +50,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultPages'); $this->importScenarioDataSet('LiveDefaultElements'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php index 814ab5cfead9e0346998a1c5222d557e58d16ae1..7b14ec606794d06d6ae2ee533a8806eb7b062ba9 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php @@ -109,14 +109,18 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\ */ public function copyParentContentToLanguageWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + parent::copyParentContentToLanguage(); $this->assertAssertionDataSet('copyParentContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); - $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); + + $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default'); $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel) ->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1')); @@ -128,6 +132,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\ */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + parent::localizeParentContentWithAllChildren(); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -143,6 +150,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\ */ public function localizeParentContentWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + parent::localizeParentContentWithLanguageSynchronization(); $this->assertAssertionDataSet('localizeParentContentLanguageSynchronization'); @@ -314,6 +324,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\ */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php index ae682c0b2f78258a67e35dd205d1f0203c76b042..2ae513036085a910339f9ba3560800e2485a6d5d 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/AbstractActionTestCase.php @@ -55,6 +55,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultPages'); $this->importScenarioDataSet('LiveDefaultElements'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage( 1, [ diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php index f969b784c7958e9dff71e468a795430eea661ebb..a57624b96c41d886f882e9cf3e2246dc568fb9d5 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php @@ -109,14 +109,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function copyParentContentToLanguageWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyParentContentToLanguageWithAllChildren(); $this->assertAssertionDataSet('copyParentContentToLanguageWAllChildren'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()'); $this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint() ->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentHotel) @@ -129,6 +130,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithAllChildren(); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -144,6 +147,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithLanguageSynchronization(); $this->assertAssertionDataSet('localizeParentContentSynchronization'); @@ -159,6 +164,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentChainLanguageSynchronizationSource() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeParentContentChainLanguageSynchronizationSource(); $this->assertAssertionDataSet('localizeParentContentChainLanguageSynchronizationSource'); @@ -174,6 +182,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentAndCreateNestedChildrenWithLanguageSynchronization(); $this->assertAssertionDataSet('localizeParentContentNCreateNestedChildrenWLanguageSynchronization'); @@ -189,6 +199,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentAndSetInvalidChildReferenceWithLanguageSynchronization(); // the assertion is the same as for localizeParentContentWithLanguageSynchronization() $this->assertAssertionDataSet('localizeParentContentSynchronization'); @@ -205,6 +217,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentAndSetInvalidChildReferenceWithLateLanguageSynchronization(); // the assertion is the same as for localizeParentContentWithLanguageSynchronization() $this->assertAssertionDataSet('localizeParentContentSynchronization'); @@ -377,6 +391,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); @@ -397,6 +413,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore */ public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php index 5a0e89c347a7353962453c79ff83d6962668eb9c..ad0aa64218e7bbeb6a52a2d65a5668c30fbf176a 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php @@ -48,6 +48,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultPages'); $this->importScenarioDataSet('LiveDefaultElements'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php index f2a0f0ba9ab9d88ad44977dda88302c9381770f6..115e993993d0708c27f35d538fa5eab8eac40263 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php @@ -278,6 +278,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\ManyToMan */ public function localizeCategoryOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeCategoryOfRelation(); $this->assertAssertionDataSet('localizeCategoryOfRelation'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php index 8cc48c7a5f82eb58b8c9413d4a2f120fcc86d393..be755311b7e5313a5c582622c3a40d50383daab0 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/AbstractActionTestCase.php @@ -45,6 +45,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultPages'); $this->importScenarioDataSet('LiveDefaultElements'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); $this->setWorkspaceId(0); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php index 371497598fcaef00ef2eb0a482fd36f28bfeb8c5..8a64f242eefa856a2f8e7b9f09b317e61f891973 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php @@ -48,6 +48,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function createContentForLanguageAll() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::createContentForLanguageAll(); $this->assertAssertionDataSet('createContentForLanguageAll'); @@ -121,13 +124,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function copyContentToLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguage(); $this->assertAssertionDataSet('copyContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2')); @@ -139,13 +144,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function copyContentToLanguageWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguageWithLanguageSynchronization(); $this->assertAssertionDataSet('copyContentToLanguageWSynchronization'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2')); @@ -157,13 +164,15 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function copyContentToLanguageWithLocalizationExclude() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguageWithLocalizationExclude(); $this->assertAssertionDataSet('copyContentToLanguageWExclude'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #1', '[Translate to Dansk:] Regular Element #3', 'Regular Element #2 (copy 1)')); @@ -175,13 +184,16 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function copyContentToLanguageFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::copyContentToLanguageFromNonDefaultLanguage(); $this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "de" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageIdSecond]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3')); @@ -207,6 +219,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->assertAssertionDataSet('localizeContent'); @@ -222,6 +236,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentWithEmptyTcaIntegrityColumns() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContentWithEmptyTcaIntegrityColumns(); $this->assertAssertionDataSet('localizeContent'); @@ -236,6 +252,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContentWithLanguageSynchronization(); $this->assertAssertionDataSet('localizeContentWSynchronization'); @@ -250,6 +268,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentWithLanguageSynchronizationHavingNullValue() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContentWithLanguageSynchronizationHavingNullValue(); $this->assertAssertionDataSet('localizeContentWSynchronizationHNull'); @@ -264,6 +284,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeContentFromNonDefaultLanguage(); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage'); @@ -279,6 +302,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationDefault(); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationDefault'); @@ -294,6 +320,9 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeContentFromNonDefaultLanguageWithLanguageSynchronizationSource(); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguageWSynchronizationSource'); @@ -309,6 +338,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function createLocalizedContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createLocalizedContent(); $this->assertAssertionDataSet('createLocalizedContent'); @@ -324,6 +355,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\A */ public function createLocalizedContentWithLanguageSynchronization() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createLocalizedContentWithLanguageSynchronization(); $this->assertAssertionDataSet('createLocalizedContentWSynchronization'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSiteTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSiteTest.php index d5fe222107332aee5b02ec2ab8cca73ecfa6297c..cbe32a7177b194727431322354e265602b4ee63e 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSiteTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Regular/MultiSiteTest.php @@ -48,6 +48,7 @@ class MultiSiteTest extends AbstractDataHandlerActionTestCase $this->importScenarioDataSet('LiveDefaultElements'); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); } /** diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php index d20d271018a61cbbe578bc56b40683ebdbd3c213..657978d2bb40b1b0099d953198045db0c0df4626 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Select/AbstractActionTestCase.php @@ -47,6 +47,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D $this->importScenarioDataSet('LiveDefaultElements'); $this->importScenarioDataSet('ReferenceIndex'); + $this->setUpFrontendSite(1, $this->siteLanguageConfiguration); $this->setUpFrontendRootPage(1, ['typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/ActionTest.php b/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/ActionTest.php index e5a7d0a76e37db7665db39aeb0ffbe211f8c55b3..0bf40d69a2954bb72324cdd09562177f81fffc31 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/ActionTest.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/ActionTest.php @@ -287,6 +287,8 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Select\Ab */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv b/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv index c024c2a307e43c991ed3a1b64ca32733cc8819fb..330bcbeaac8121746576cecf741f313135d36c03 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/core/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select" ,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript b/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript deleted file mode 100644 index ea342708feac5cbb1d20e5e264e2e5cc11ba6773..0000000000000000000000000000000000000000 --- a/typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript +++ /dev/null @@ -1,3 +0,0 @@ -config { - sys_language_overlay = 0 -} \ No newline at end of file diff --git a/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php b/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php index 55dfeb829a0b0f07ee877174f7998178926a5e0f..9be09d8316a81c4af4c99f36fed69dc0480cb3a5 100644 --- a/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php +++ b/typo3/sysext/extbase/Tests/Functional/Persistence/EnableFieldsTest.php @@ -45,6 +45,7 @@ class EnableFieldsTest extends AbstractDataHandlerActionTestCase $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/fe_users.xml'); $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/blogs-with-fe_groups.xml'); + $this->setUpFrontendSite(1); $this->setUpFrontendRootPage(1, ['typo3/sysext/extbase/Tests/Functional/Persistence/Fixtures/Frontend/JsonRenderer.typoscript']); } diff --git a/typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php b/typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php index 99c2150e86d3147fe4e13cbf67baddddfe3f50a1..0673b573d3701d37bc395b197328c56277272b82 100644 --- a/typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php +++ b/typo3/sysext/fluid/Tests/Functional/View/TemplatesPathsTest.php @@ -14,11 +14,20 @@ namespace TYPO3\CMS\Fluid\Tests\Functional\View; * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; class TemplatesPathsTest extends FunctionalTestCase { + use SiteBasedTestTrait; + + /** + * @var array + */ + protected const LANGUAGE_PRESETS = [ + 'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'], + ]; /** * @var array */ @@ -68,6 +77,16 @@ class TemplatesPathsTest extends FunctionalTestCase parent::setUp(); $this->importDataSet('PACKAGE:typo3/testing-framework/Resources/Core/Functional/Fixtures/pages.xml'); + $this->writeSiteConfiguration( + 'test', + $this->buildSiteConfiguration(1, 'https://website.local/'), + [ + $this->buildDefaultLanguageConfiguration('EN', '/en/'), + ], + [ + $this->buildErrorHandlingConfiguration('Fluid', [404]) + ] + ); $this->setUpFrontendRootPage(1, ['EXT:fluid_test/Configuration/TypoScript/Basic.ts']); } @@ -298,7 +317,7 @@ class TemplatesPathsTest extends FunctionalTestCase protected function fetchFrontendResponseBody(array $requestArguments): string { $response = $this->executeFrontendRequest( - (new InternalRequest())->withQueryParameters($requestArguments) + (new InternalRequest('https://website.local/en/'))->withQueryParameters($requestArguments) ); return (string)$response->getBody(); diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml index 117accc506b4826ed66f8f5851d7a5a934eff318..2c84e0b12f3397dc49035cd6c0d33623f11be0f7 100644 --- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml +++ b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml @@ -2,6 +2,7 @@ <dataset> <pages> <uid>1</uid> - <title>Seitentitel</title> + <title>Root Page Title</title> + <slug>/</slug> </pages> -</dataset> \ No newline at end of file +</dataset> diff --git a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php index 83ba4d5309d6387d796409fc03f97b60b79f993b..482ae66dc1e2a76c5fc4ea376b2e4bc0bfcb40b5 100644 --- a/typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php +++ b/typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php @@ -15,10 +15,26 @@ namespace TYPO3\CMS\Fluid\Tests\Functional\ViewHelpers; * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait; use TYPO3\CMS\Fluid\View\StandaloneView; class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase { + use SiteBasedTestTrait; + + /** + * @var array + */ + protected const LANGUAGE_PRESETS = [ + 'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'], + ]; + + protected $configurationToUseInTestInstance = [ + 'FE' => [ + 'encryptionKey' => '12345' + ] + ]; + /** * @var array */ @@ -34,7 +50,16 @@ class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\Fun parent::setUp(); $this->importDataSet('typo3/sysext/fluid/Tests/Functional/ViewHelpers/Fixtures/pages.xml'); - + $this->writeSiteConfiguration( + 'test', + $this->buildSiteConfiguration(1, '/'), + [ + $this->buildDefaultLanguageConfiguration('EN', '/en/'), + ], + [ + $this->buildErrorHandlingConfiguration('Fluid', [404]) + ] + ); $_GET = [ 'foo' => 'bar', 'temp' => 'test', @@ -79,56 +104,56 @@ class TypolinkViewHelperTest extends \TYPO3\TestingFramework\Core\Functional\Fun 'addQueryString' => false, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => '', - 'expected' => '<a href="index.php?id=1">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>', + 'expected' => '<a href="/en/">This is a testlink</a> <a href="/en/">This is a testlink</a>', 'template' => 'link_typolink_viewhelper', ], 'link: with add query string' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => '', - 'expected' => '<a href="index.php?id=1&foo=bar&temp=test">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>', + 'expected' => '<a href="/en/?foo=bar&temp=test&cHash=286759dfcd3f566fa21091a0d77e9831">This is a testlink</a> <a href="/en/">This is a testlink</a>', 'template' => 'link_typolink_viewhelper', ], 'link: with add query string and exclude' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => 'temp', - 'expected' => '<a href="index.php?id=1&foo=bar">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>', + 'expected' => '<a href="/en/?foo=bar&cHash=afa4b37588ab917af3cfe2cd4464029d">This is a testlink</a> <a href="/en/">This is a testlink</a>', 'template' => 'link_typolink_viewhelper', ], 'link: with add query string and method POST' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'POST', 'addQueryStringExclude' => 'temp', - 'expected' => '<a href="index.php?id=1">This is a testlink</a> <a href="index.php?id=1">This is a testlink</a>', + 'expected' => '<a href="/en/">This is a testlink</a> <a href="/en/">This is a testlink</a>', 'template' => 'link_typolink_viewhelper', ], 'uri: default' => [ 'addQueryString' => false, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => '', - 'expected' => 'index.php?id=1 index.php?id=1', + 'expected' => '/en/ /en/', 'template' => 'uri_typolink_viewhelper', ], 'uri: with add query string' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => '', - 'expected' => 'index.php?id=1&foo=bar&temp=test index.php?id=1', + 'expected' => '/en/?foo=bar&temp=test&cHash=286759dfcd3f566fa21091a0d77e9831 /en/', 'template' => 'uri_typolink_viewhelper', ], 'uri: with add query string and exclude' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'GET', 'addQueryStringExclude' => 'temp', - 'expected' => 'index.php?id=1&foo=bar index.php?id=1', + 'expected' => '/en/?foo=bar&cHash=afa4b37588ab917af3cfe2cd4464029d /en/', 'template' => 'uri_typolink_viewhelper', ], 'uri: with add query string and method POST' => [ 'addQueryString' => true, 'addQueryStringMethod' => 'POST', 'addQueryStringExclude' => 'temp', - 'expected' => 'index.php?id=1 index.php?id=1', + 'expected' => '/en/ /en/', 'template' => 'uri_typolink_viewhelper', ], ]; diff --git a/typo3/sysext/frontend/Classes/Middleware/PageResolver.php b/typo3/sysext/frontend/Classes/Middleware/PageResolver.php index 508ad4b1ca2199c6b3147f1dee7debb7ea7562bc..9507d349c72bbfddd475dfb4b5093468907a033e 100644 --- a/typo3/sysext/frontend/Classes/Middleware/PageResolver.php +++ b/typo3/sysext/frontend/Classes/Middleware/PageResolver.php @@ -87,15 +87,23 @@ class PageResolver implements MiddlewareInterface } $requestId = (string)($request->getQueryParams()['id'] ?? ''); - if (!empty($requestId) && !empty($page = $this->resolvePageId($requestId))) { + if (!empty($requestId)) { // Legacy URIs (?id=12345) takes precedence, not matter if a route is given - $pageArguments = new PageArguments( - (int)($page['l10n_parent'] ?: $page['uid']), - (string)($request->getQueryParams()['type'] ?? '0'), - [], - [], - $request->getQueryParams() - ); + if (!empty($page = $this->resolvePageId($requestId))) { + $pageArguments = new PageArguments( + (int)($page['l10n_parent'] ?: $page['uid']), + (string)($request->getQueryParams()['type'] ?? '0'), + [], + [], + $request->getQueryParams() + ); + } else { + return GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction( + $request, + 'The requested page does not exist', + ['code' => PageAccessFailureReasons::PAGE_NOT_FOUND] + ); + } } else { // Check for the route try { diff --git a/typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml b/typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml index 0870a5d10536943970f35f448005ff1950b50ad0..687fe77406bf81daca78bd9dcfa048fcda9f95cc 100644 --- a/typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml +++ b/typo3/sysext/frontend/Tests/Functional/Fixtures/pages.xml @@ -5,6 +5,7 @@ <pid>0</pid> <title>Root 1</title> <deleted>0</deleted> + <slug>/</slug> <perms_everybody>15</perms_everybody> </pages> <pages> diff --git a/typo3/sysext/frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript b/typo3/sysext/frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript index 639751bfe6e9d0fffa64aa85a307bc0a55e442cd..f4935c498b0078ae4a0b83cfb5a4768003f2961e 100644 --- a/typo3/sysext/frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript +++ b/typo3/sysext/frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript @@ -1,3 +1,4 @@ +config.absRefPrefix = page = PAGE page { includeCSS { diff --git a/typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php b/typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php index 9951a5239b18abdee54f4b67f9a3f530916b5999..bb2a8659a251c22b920a2fc2600f881489f9e02b 100644 --- a/typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php +++ b/typo3/sysext/frontend/Tests/Functional/Rendering/LocalizedSiteContentRenderingTest.php @@ -730,7 +730,7 @@ class LocalizedSiteContentRenderingTest extends \TYPO3\CMS\Core\Tests\Functional //Expected behaviour: //Setting sys_language_mode to different values doesn't influence the result as the requested page is translated to Polish, - //Page title is always [PL]Page, and both sys_language_content and sys_language_uid are always 3 + //Page title is always [PL]Page, and both languageId/contentId are always 3 return [ [ 'languageConfiguration' => [ diff --git a/typo3/sysext/frontend/Tests/Functional/Rendering/TitleTagRenderingTest.php b/typo3/sysext/frontend/Tests/Functional/Rendering/TitleTagRenderingTest.php index 7671ace3ce161d696d731c977142bd0f4904ea4c..1e5b69cc4addac2033ec349e71cf92e1335768d3 100644 --- a/typo3/sysext/frontend/Tests/Functional/Rendering/TitleTagRenderingTest.php +++ b/typo3/sysext/frontend/Tests/Functional/Rendering/TitleTagRenderingTest.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Frontend\Tests\Functional\Rendering; * The TYPO3 project - inspiring people to share! */ +use Symfony\Component\Yaml\Yaml; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; @@ -48,12 +49,48 @@ class TitleTagRenderingTest extends FunctionalTestCase 1, ['EXT:frontend/Tests/Functional/Rendering/Fixtures/TitleTagRenderingTest.typoscript'] ); + $this->setUpFrontendSite(1); $this->setSiteTitleToTemplateRecord( 1, 'Site Title' ); } + /** + * Create a simple site config for the tests that + * call a frontend page. + * + * @param int $pageId + */ + protected function setUpFrontendSite(int $pageId) + { + $configuration = [ + 'rootPageId' => $pageId, + 'base' => '/', + 'languages' => [ + [ + 'title' => 'English', + 'enabled' => true, + 'languageId' => '0', + 'base' => '/', + 'typo3Language' => 'default', + 'locale' => 'en_US.UTF-8', + 'iso-639-1' => 'en', + 'navigationTitle' => '', + 'hreflang' => '', + 'direction' => '', + 'flag' => 'us', + ] + ], + 'errorHandling' => [], + 'routes' => [], + ]; + GeneralUtility::mkdir_deep($this->instancePath . '/typo3conf/sites/testing/'); + $yamlFileContents = Yaml::dump($configuration, 99, 2); + $fileName = $this->instancePath . '/typo3conf/sites/testing/config.yaml'; + GeneralUtility::writeFile($fileName, $yamlFileContents); + } + public function titleTagDataProvider(): array { return [ diff --git a/typo3/sysext/frontend/Tests/Functional/Rendering/UriPrefixRenderingTest.php b/typo3/sysext/frontend/Tests/Functional/Rendering/UriPrefixRenderingTest.php index 3297d3fa6318e57f3059a0da596f676a501144ff..5f3f9dd826f90f2f75dab7a8305c359228e3fc89 100644 --- a/typo3/sysext/frontend/Tests/Functional/Rendering/UriPrefixRenderingTest.php +++ b/typo3/sysext/frontend/Tests/Functional/Rendering/UriPrefixRenderingTest.php @@ -3,13 +3,29 @@ declare(strict_types = 1); namespace TYPO3\CMS\Frontend\Tests\Functional\Rendering; +/* + * This file is part of the TYPO3 CMS project. + * + * It is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License, either version 2 + * of the License, or any later version. + * + * For the full copyright and license information, please read the + * LICENSE.txt file that was distributed with this source code. + * + * The TYPO3 project - inspiring people to share! + */ + use TYPO3\CMS\Core\Database\ConnectionPool; +use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; class UriPrefixRenderingTest extends FunctionalTestCase { + use SiteBasedTestTrait; + /** * @var string[] */ @@ -23,7 +39,6 @@ class UriPrefixRenderingTest extends FunctionalTestCase 'extensionJS' => 'EXT:core/Resources/Public/JavaScript/Contrib/jquery.autocomplete.js', 'externalJS' => 'https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js', 'localImage' => 'typo3/sysext/frontend/Resources/Public/Icons/Extension.png', - 'localLink' => '1', ]; /** @@ -37,7 +52,6 @@ class UriPrefixRenderingTest extends FunctionalTestCase 'extensionJS' => 'typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery.autocomplete.js', 'externalJS' => 'https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js', 'localImage' => 'typo3/sysext/frontend/Resources/Public/Icons/Extension.png', - 'localLink' => 'index.php?id=1', ]; /** @@ -54,10 +68,24 @@ class UriPrefixRenderingTest extends FunctionalTestCase 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/AdditionalConfiguration.php' => 'typo3conf/AdditionalConfiguration.php', ]; + protected const LANGUAGE_PRESETS = [ + 'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8', 'iso' => 'en', 'hrefLang' => 'en-US'], + ]; + protected function setUp(): void { parent::setUp(); $this->importDataSet('EXT:frontend/Tests/Functional/Fixtures/pages.xml'); + $this->writeSiteConfiguration( + 'test', + $this->buildSiteConfiguration(1, '/'), + [ + $this->buildDefaultLanguageConfiguration('EN', '/en/'), + ], + [ + $this->buildErrorHandlingConfiguration('Fluid', [404]) + ] + ); $this->setUpFrontendRootPage( 1, ['EXT:frontend/Tests/Functional/Rendering/Fixtures/UriPrefixRenderingTest.typoscript'] @@ -320,7 +348,7 @@ class UriPrefixRenderingTest extends FunctionalTestCase [ preg_quote($candidate, '#'), preg_quote($pathInfo['filename'], '#'), - preg_quote($pathInfo['extension'], '#'), + preg_quote($pathInfo['extension'] ?? '', '#'), ], $expectation ); diff --git a/typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/SlugScenario.yaml b/typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/SlugScenario.yaml index d58412ab65602d2cea0a308e117a44fc17f8fa1e..8bb31e00a15e33379f606f2201138d1f37b4c3f2 100644 --- a/typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/SlugScenario.yaml +++ b/typo3/sysext/frontend/Tests/Functional/SiteHandling/Fixtures/SlugScenario.yaml @@ -134,7 +134,7 @@ entities: - self: {id: 3110, title: 'EN: Markets', slug: '/archive/markets'} - self: {id: 3120, title: 'EN: Products', slug: '/archive/products'} - self: {id: 3130, title: 'EN: Partners', slug: '/archive/partners'} - - self: {id: 7000, title: 'Common Collection', type: *pageFolder, slug: '/common'} + - self: {id: 7000, title: 'Common Collection', type: *pageFolder, root: true, slug: '/common'} children: - self: {id: 7100, title: 'Announcements & News', slug: '/common/news'} children: diff --git a/typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php b/typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php index c57fd35b931116879db1bd9b42272365547859f2..ddb7426a575cb670439c9340252e4c06e3ff2137 100644 --- a/typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php +++ b/typo3/sysext/frontend/Tests/Functional/SiteHandling/SlugLinkGeneratorTest.php @@ -84,6 +84,19 @@ class SlugLinkGeneratorTest extends AbstractTestCase 'jane-blog-acme-com', $this->buildSiteConfiguration(2120, 'https://blog.acme.com/jane/') ); + $this->writeSiteConfiguration( + 'archive-acme-com', + $this->buildSiteConfiguration(3000, 'https://archive.acme.com/'), + [ + $this->buildDefaultLanguageConfiguration('EN', '/'), + $this->buildLanguageConfiguration('FR', 'https://archive.acme.com/fr/', ['EN']), + $this->buildLanguageConfiguration('FR-CA', 'https://archive.acme.com/ca/', ['FR', 'EN']) + ] + ); + $this->writeSiteConfiguration( + 'common-collection', + $this->buildSiteConfiguration(7000, 'https://common.acme.com/') + ); $this->withDatabaseSnapshot(function () { $this->setUpDatabase(); @@ -288,11 +301,11 @@ class SlugLinkGeneratorTest extends AbstractTestCase ['https://acme.us/', 1100, 1411, 0, 'https://acme.fr/acme-dans-votre-region/groupes'], ['https://acme.us/', 1100, 1412, 0, 'https://acme.ca/acme-dans-votre-quebec/groupes'], // acme.com -> archive (outside site) - ['https://acme.us/', 1100, 3100, 0, '/index.php?id=3100&L=0'], - ['https://acme.us/', 1100, 3100, 1, '/index.php?id=3100&L=1'], - ['https://acme.us/', 1100, 3100, 2, '/index.php?id=3100&L=2'], - ['https://acme.us/', 1100, 3101, 0, '/index.php?id=3100&L=1'], - ['https://acme.us/', 1100, 3102, 0, '/index.php?id=3100&L=2'], + ['https://acme.us/', 1100, 3100, 0, 'https://archive.acme.com/archive/statistics'], + ['https://acme.us/', 1100, 3100, 1, 'https://archive.acme.com/fr/archive/statistics'], + ['https://acme.us/', 1100, 3100, 2, 'https://archive.acme.com/ca/archive/statistics'], + ['https://acme.us/', 1100, 3101, 0, 'https://archive.acme.com/fr/archive/statistics'], + ['https://acme.us/', 1100, 3102, 0, 'https://archive.acme.com/ca/archive/statistics'], // blog.acme.com -> acme.com (different site) ['https://blog.acme.com/', 2100, 1100, 0, 'https://acme.us/welcome'], ['https://blog.acme.com/', 2100, 1100, 1, 'https://acme.fr/bienvenue'], @@ -300,11 +313,11 @@ class SlugLinkGeneratorTest extends AbstractTestCase ['https://blog.acme.com/', 2100, 1101, 0, 'https://acme.fr/bienvenue'], ['https://blog.acme.com/', 2100, 1102, 0, 'https://acme.ca/bienvenue'], // blog.acme.com -> archive (outside site) - ['https://blog.acme.com/', 2100, 3100, 0, '/index.php?id=3100&L=0'], - ['https://blog.acme.com/', 2100, 3100, 1, '/index.php?id=3100&L=1'], - ['https://blog.acme.com/', 2100, 3100, 2, '/index.php?id=3100&L=2'], - ['https://blog.acme.com/', 2100, 3101, 0, '/index.php?id=3100&L=1'], - ['https://blog.acme.com/', 2100, 3102, 0, '/index.php?id=3100&L=2'], + ['https://blog.acme.com/', 2100, 3100, 0, 'https://archive.acme.com/archive/statistics'], + ['https://blog.acme.com/', 2100, 3100, 1, 'https://archive.acme.com/fr/archive/statistics'], + ['https://blog.acme.com/', 2100, 3100, 2, 'https://archive.acme.com/ca/archive/statistics'], + ['https://blog.acme.com/', 2100, 3101, 0, 'https://archive.acme.com/fr/archive/statistics'], + ['https://blog.acme.com/', 2100, 3102, 0, 'https://archive.acme.com/ca/archive/statistics'], // blog.acme.com -> products.acme.com (different sub-site) ['https://blog.acme.com/', 2100, 1300, 0, 'https://products.acme.com/products'], ['https://blog.acme.com/', 2100, 1310, 0, 'https://products.acme.com/products/planets'], @@ -343,33 +356,6 @@ class SlugLinkGeneratorTest extends AbstractTestCase static::assertSame($expectation, (string)$response->getBody()); } - /** - * @param string $hostPrefix - * @param int $sourcePageId - * @param int $targetPageId - * @param int $targetLanguageId - * @param string $expectation - * - * @test - * @dataProvider linkIsGeneratedForLanguageDataProvider - */ - public function linkIsGeneratedForLanguageWithLegacyProperty(string $hostPrefix, int $sourcePageId, int $targetPageId, int $targetLanguageId, string $expectation) - { - $response = $this->executeFrontendRequest( - (new InternalRequest($hostPrefix)) - ->withPageId($sourcePageId) - ->withInstructions([ - $this->createTypoLinkUrlInstruction([ - 'parameter' => $targetPageId, - 'additionalParams' => '&L=' . $targetLanguageId, - ]) - ]), - $this->internalRequestContext - ); - - static::assertSame($expectation, (string)$response->getBody()); - } - /** * @return array */ @@ -706,15 +692,15 @@ class SlugLinkGeneratorTest extends AbstractTestCase 'children' => [ [ 'title' => 'Markets', - 'link' => '/index.php?id=7110&MP=7100-1700', + 'link' => 'https://common.acme.com/common/markets?MP=7100-1700', ], [ 'title' => 'Products', - 'link' => '/index.php?id=7120&MP=7100-1700', + 'link' => 'https://common.acme.com/common/products?MP=7100-1700', ], [ 'title' => 'Partners', - 'link' => '/index.php?id=7130&MP=7100-1700', + 'link' => 'https://common.acme.com/common/partners?MP=7100-1700', ], ], ], @@ -747,15 +733,15 @@ class SlugLinkGeneratorTest extends AbstractTestCase 'children' => [ [ 'title' => 'Markets', - 'link' => '/index.php?id=7110&MP=7100-2700', + 'link' => 'https://common.acme.com/common/markets?MP=7100-2700', ], [ 'title' => 'Products', - 'link' => '/index.php?id=7120&MP=7100-2700', + 'link' => 'https://common.acme.com/common/products?MP=7100-2700', ], [ 'title' => 'Partners', - 'link' => '/index.php?id=7130&MP=7100-2700', + 'link' => 'https://common.acme.com/common/partners?MP=7100-2700', ], ], ], diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php index 0c63aa0df4c3b8b2a4ca0e7c43b3db945db3b975..3316b8f6e202ccf94d6dba17c3f096df253e8c6d 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Modify/ActionTest.php @@ -84,6 +84,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL */ public function localizeContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->assertAssertionDataSet('localizeContent'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php index b8318814c95d4d46c457d2531de842605235543a..d71b701b087ce577ec951afdc95e14250473fabc 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/Publish/ActionTest.php @@ -87,6 +87,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL */ public function localizeContent() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeContent(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('localizeContent'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php index 5f4c5b611ac9556da47a83b9d9bbef1a408240a2..2abcb787122519db634d92d77bb662695eb774d8 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/FAL/PublishAll/ActionTest.php @@ -87,6 +87,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\FAL */ public function localizeContent() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeContent'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/ActionTest.php index efe5ff48a74492fbc8656b6a741476f3fd30ea98..347f53a45debf6e46738a616bb1e16c08e9c8e6d 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/ActionTest.php @@ -256,6 +256,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv index 846a889db9f5a3e825f423e87962eb441059c8a1..61ede3492a9447ae36b833c47a0d29dab1a58fa6 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Modify/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,8 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,1,1,0,0,0,"[Translate to Dansk:] Relations",,, +,92,-1,256,0,1,-1,0,91,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/ActionTest.php index 6fe84fae607f64bb3fa029df6e4671fbd957f588..9c4e5268f888c2381df460c9f231d6664e75bbc2 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/ActionTest.php @@ -280,6 +280,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro */ public function localizeElementOfRelation() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord('pages', $translatedPageResult['pages'][self::VALUE_PageId]); parent::localizeElementOfRelation(); $this->actionService->publishRecord(self::TABLE_Element, $this->recordIds['localizedElementId']); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/DataSet/localizeElementOfRelation.csv index 98a6d88a8185817c0a22d1c8081bcdf9871b6ebd..eb15924261f75ae2ade6ebb15613fbbdaee7e01f 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/Publish/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/ActionTest.php index b2acbb1bdeaccb40fa26eb6fabb382d587eb9950..f5382ee84e088fd2411912e9a975205d654e18ad 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/ActionTest.php @@ -270,6 +270,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Gro */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/DataSet/localizeElementOfRelation.csv index 98a6d88a8185817c0a22d1c8081bcdf9871b6ebd..eb15924261f75ae2ade6ebb15613fbbdaee7e01f 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Group/PublishAll/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_group" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php index e581d3ea466a229d9d342e06ace8534bf0496fd3..2d150dba3ad4084926817654a5a44d44d9bcfd77 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Modify/ActionTest.php @@ -123,6 +123,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithAllChildren(); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -313,6 +315,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php index 86eea8647153f646254a0e3d02378e38d973b6fb..9a0419d71c9cfab22e6df2b1ef63101dff8bac5c 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/Publish/ActionTest.php @@ -126,6 +126,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeParentContentWithAllChildren(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -344,6 +347,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/ActionTest.php index f3701cb9c0d8cbd6ecef3e09d0e091afb8c0d534..aad501020a50fd67830d2059e106c8b618a022f4 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/CSV/PublishAll/ActionTest.php @@ -125,6 +125,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithAllChildren(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -326,6 +328,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php index 32656a87b3c71d0383e421f843549fe6d08842f6..1e61ad65c9e63293f2f1cec9654a7e924d72b022 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php @@ -123,6 +123,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithAllChildren(); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -313,6 +315,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); @@ -333,6 +337,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildrenWithoutSortByConfiguration(); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildrenWOSortBy'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/ActionTest.php index 39b394fd05d2def3f45dc5c6929c60f2960795f5..2053e0862bc0b118626dfe80f07bae8c53ab03ad 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/Publish/ActionTest.php @@ -130,6 +130,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeParentContentWithAllChildren(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -349,6 +352,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['newContentId']); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/ActionTest.php index 5a7be5b297d967912119073fc3f03efab77db346..52fbe93deb62a5eaa2b1daf380fc35add558e63d 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/IRRE/ForeignField/PublishAll/ActionTest.php @@ -129,6 +129,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function localizeParentContentWithAllChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeParentContentWithAllChildren(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeParentContentWAllChildren'); @@ -331,6 +333,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\IRR */ public function createAndLocalizeParentContentWithHotelAndOfferChildren() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::createAndLocalizeParentContentWithHotelAndOfferChildren(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('createNLocalizeParentContentNHotelNOfferChildren'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php index 8f98a9940ec2fa666add1e40ded3772f3133173d..4cfe37291886f8246c0276eebb66813ed03028dc 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Modify/ActionTest.php @@ -283,6 +283,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man */ public function localizeCategoryOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeCategoryOfRelation(); $this->assertAssertionDataSet('localizeCategoryOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php index 797e10f8ed26c2f2d9c798bbed22448562bf8da5..0eae14d0e49aa6d24462f53325b184a7223502e4 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/Publish/ActionTest.php @@ -326,6 +326,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man */ public function localizeCategoryOfRelation() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeCategoryOfRelation(); $this->actionService->publishRecord(self::TABLE_Category, $this->recordIds['localizedCategoryId']); $this->assertAssertionDataSet('localizeCategoryOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php index 008f51a3a3f5e6874291b6869114b7fe2de4ca9e..253fc4fd08036190847151fc941271af0a899ba6 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/PublishAll/ActionTest.php @@ -300,6 +300,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Man */ public function localizeCategoryOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeCategoryOfRelation(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeCategoryOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php index 6e9dc97622266c354e024324196fde4dd5ee97a1..54ffae91de04ad28c90f736ca7fe6038f562390c 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php @@ -136,13 +136,15 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguage(); $this->assertAssertionDataSet('copyContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2')); @@ -154,13 +156,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguageFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::copyContentToLanguageFromNonDefaultLanguage(); $this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "de" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageIdSecond]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3')); @@ -172,6 +177,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->assertAssertionDataSet('localizeContent'); @@ -186,6 +193,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContentFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeContentFromNonDefaultLanguage(); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage'); @@ -455,7 +465,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('createContentAndCopyDraftPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint() ->setTable(static::TABLE_Content)->setField('header')->setValues('Testing #1')); @@ -488,7 +498,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('createPageAndCopyDraftParentPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint() ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1')); @@ -521,7 +531,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('createNestedPagesAndCopyDraftParentPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint() ->setTable(static::TABLE_Page)->setField('title')->setValues('Testing #1')); @@ -554,7 +564,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('deleteContentAndCopyDraftPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2')); @@ -590,7 +600,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('changeContentSortingAndCopyDraftPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #1')); @@ -623,7 +633,7 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg $this->assertAssertionDataSet('moveContentAndCopyDraftPage'); $resultLive = $this->getFrontendResult($this->recordIds['copiedPageId']); - $this->assertStringContainsString('Reason: ID was not an accessible page', $resultLive['stdout']); + $this->assertStringContainsString('The requested page does not exist', $resultLive['stdout']); $responseSectionsDraft = $this->getFrontendResponse($this->recordIds['copiedPageId'], 0, static::VALUE_BackendUserId, static::VALUE_WorkspaceId)->getResponseSections(); $this->assertThat($responseSectionsDraft, $this->getRequestSectionDoesNotHaveRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('Regular Element #2')); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php index d8b0d55e5bded04a348de0ad5a198d0cb4c46ca7..675919e3b74d07afccfc7a7e218ee46c88011bc3 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/Publish/ActionTest.php @@ -154,14 +154,17 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguage() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::copyContentToLanguage(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('copyContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2')); @@ -173,14 +176,17 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguageFromNonDefaultLanguage() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::copyContentToLanguageFromNonDefaultLanguage(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageIdSecond]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3')); @@ -192,6 +198,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContent() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeContent(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('localizeContent'); @@ -207,6 +216,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContentFromNonDefaultLanguage() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); + $this->actionService->publishRecord(self::TABLE_Page, $translatedPageResult[self::TABLE_Page][self::VALUE_PageId]); parent::localizeContentFromNonDefaultLanguage(); $this->actionService->publishRecord(self::TABLE_Content, $this->recordIds['localizedContentId']); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php index 836a70114a0cd20c4c7f3c5ff74ce04f34ff1cd7..cb322b77a46a5cab85aec7115e0054e0c5053d0b 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Regular/PublishAll/ActionTest.php @@ -143,14 +143,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::copyContentToLanguage(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('copyContentToLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "dk" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageId]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Dansk:] Regular Element #3', '[Translate to Dansk:] Regular Element #2')); @@ -162,14 +164,16 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function copyContentToLanguageFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::copyContentToLanguageFromNonDefaultLanguage(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('copyContentToLanguageFromNonDefaultLanguage'); - $this->setUpFrontendRootPage(1, [ - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.typoscript', - 'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.typoscript' - ]); + // Set up "de" to not have overlays + $languageConfiguration = $this->siteLanguageConfiguration; + $languageConfiguration[self::VALUE_LanguageIdSecond]['fallbackType'] = 'free'; + $this->setUpFrontendSite(1, $languageConfiguration); $responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageIdSecond)->getResponseSections(); $this->assertThat($responseSections, $this->getRequestSectionHasRecordConstraint() ->setTable(self::TABLE_Content)->setField('header')->setValues('[Translate to Deutsch:] [Translate to Dansk:] Regular Element #3')); @@ -181,6 +185,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContent() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeContent(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeContent'); @@ -196,6 +202,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Reg */ public function localizeContentFromNonDefaultLanguage() { + // Create translated page first + $this->actionService->copyRecordToLanguage(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond); parent::localizeContentFromNonDefaultLanguage(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeContentFromNonDefaultLanguage'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/ActionTest.php index ef0a7ab7f48b7cb95b45dd58035df96669ef3938..c8e6c7143169e8700602b939fa68451dd4e3bab8 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/ActionTest.php @@ -256,6 +256,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv index 8f4e06dcf66820defc3835a9f1017c1a42851329..0d3770a2c5a4ebc5e021171a61ff9e854d380276 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Modify/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,8 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,1,1,0,0,0,"[Translate to Dansk:] Relations",,, +,92,-1,256,0,1,-1,0,91,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/ActionTest.php index 4fecac8e229ef0a173ca938e00356ea7906fab8d..ddb0d6a219b061c89ca0893a40a5df46f4e50894 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/ActionTest.php @@ -280,6 +280,9 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel */ public function localizeElementOfRelation() { + // Create and publish translated page first + $translatedPageResult = $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); + $this->actionService->publishRecord('pages', $translatedPageResult['pages'][self::VALUE_PageId]); parent::localizeElementOfRelation(); $this->actionService->publishRecord(self::TABLE_Element, $this->recordIds['localizedElementId']); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/DataSet/localizeElementOfRelation.csv index 113a38dcf2cefc92a2cd02399798eccb17b77343..098cb54ddf065681a4f87ace4da06208e328334b 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/Publish/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2" diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/ActionTest.php b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/ActionTest.php index 77d373a15d090de505e2588b982cc9de68254305..ca8cadad0d750639d64b114e92ae830282c5d33a 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/ActionTest.php +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/ActionTest.php @@ -270,6 +270,8 @@ class ActionTest extends \TYPO3\CMS\Workspaces\Tests\Functional\DataHandling\Sel */ public function localizeElementOfRelation() { + // Create translated page first + $this->actionService->copyRecordToLanguage('pages', self::VALUE_PageId, self::VALUE_LanguageId); parent::localizeElementOfRelation(); $this->actionService->publishWorkspace(self::VALUE_WorkspaceId); $this->assertAssertionDataSet('localizeElementOfRelation'); diff --git a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/DataSet/localizeElementOfRelation.csv b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/DataSet/localizeElementOfRelation.csv index 113a38dcf2cefc92a2cd02399798eccb17b77343..098cb54ddf065681a4f87ace4da06208e328334b 100644 --- a/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/DataSet/localizeElementOfRelation.csv +++ b/typo3/sysext/workspaces/Tests/Functional/DataHandling/Select/PublishAll/DataSet/localizeElementOfRelation.csv @@ -4,6 +4,7 @@ ,88,1,256,0,0,0,0,0,0,"DataHandlerTest",,, ,89,88,256,0,0,0,0,0,0,"Relations",,, ,90,88,512,0,0,0,0,0,0,"Target",,, +,91,88,256,0,0,0,0,0,0,"[Translate to Dansk:] Relations",,, "tt_content",,,,,,,,,,,,, ,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","tx_testdatahandler_select" ,297,89,256,0,0,0,0,0,0,0,0,"Regular Element #1","1,2"