Commit c9d79db5 authored by Tymoteusz Motylewski's avatar Tymoteusz Motylewski Committed by Anja Leichsenring
Browse files

[BUGFIX] Make copy mode of translation modal use localize

...  omitting TransOrigPointer

While translating elements with the localization modal we have to
make sure that the "Copy" mode does more than just a plain copy
followed by an update of the sys_language_uid. Otherwise related
elements will just be copied along but don't get a new language.

This patch replaces the copy action with a new action called
copyToLanguage. It behaves like localize action but does not set
TransOrigPointer fields, so child elements get the correct
language and are not connected to a language parent.

Resolves: #75400
Releases: master, 7.6
Change-Id: If57af3c94c67824ab8bbbc62a8c6bea283e96fca
Reviewed-on: https://review.typo3.org/47645


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 38a1bc5d
......@@ -365,8 +365,9 @@ abstract class FunctionalTestCase extends BaseTestCase
foreach ($typoScriptFiles as $typoScriptFile) {
$templateFields['config'] .= '<INCLUDE_TYPOSCRIPT: source="FILE:' . $typoScriptFile . '">' . LF;
}
GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template')->insert(
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template');
$connection->delete('sys_template', ['pid' => $pageId]);
$connection->insert(
'sys_template',
$templateFields
);
......
......@@ -226,22 +226,8 @@ class LocalizationController
'localize' => $destLanguageId
];
} else {
$previousUid = $this->localizationRepository->getPreviousLocalizedRecordUid(
'tt_content',
$currentUid,
$pageId,
$srcLanguageId,
$destLanguageId
);
$cmd['tt_content'][$currentUid] = [
'copy' => [
'action' => 'paste',
'target' => -$previousUid,
'update' => [
'sys_language_uid' => $destLanguageId,
'l18n_parent' => 0
]
]
'copyToLanguage' => $destLanguageId,
];
}
}
......
......@@ -181,19 +181,19 @@ class LocalizationControllerTest extends \TYPO3\CMS\Components\TestingFramework\
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test content 1 (copy 1)',
'header' => '[Translate to Deutsch:] Test content 1',
],
[
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test content 2 (copy 1)',
'header' => '[Translate to Deutsch:] Test content 2',
],
[
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test content 3 (copy 1)',
'header' => '[Translate to Deutsch:] Test content 3',
],
];
$queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tt_content');
......@@ -239,19 +239,19 @@ class LocalizationControllerTest extends \TYPO3\CMS\Components\TestingFramework\
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test indhold 1 (copy 1)',
'header' => '[Translate to Deutsch:] Test indhold 1',
],
[
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test indhold 2 (copy 1)',
'header' => '[Translate to Deutsch:] Test indhold 2',
],
[
'pid' => 1,
'sys_language_uid' => 2,
'l18n_parent' => 0,
'header' => 'Test indhold 3 (copy 1)',
'header' => '[Translate to Deutsch:] Test indhold 3',
],
];
$queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tt_content');
......@@ -321,25 +321,25 @@ class LocalizationControllerTest extends \TYPO3\CMS\Components\TestingFramework\
'pid' => 1,
'sys_language_uid' => 1,
'l18n_parent' => 0,
'header' => 'Test content 1 (copy 1)',
'header' => '[Translate to Dansk:] Test content 1',
],
[
'pid' => 1,
'sys_language_uid' => 1,
'l18n_parent' => 0,
'header' => 'Test content 2 (copy 1)',
'header' => '[Translate to Dansk:] Test content 2.5',
],
[
'pid' => 1,
'sys_language_uid' => 1,
'l18n_parent' => 0,
'header' => 'Test content 2.5 (copy 1)',
'header' => '[Translate to Dansk:] Test content 2',
],
[
'pid' => 1,
'sys_language_uid' => 1,
'l18n_parent' => 0,
'header' => 'Test content 3 (copy 1)',
'header' => '[Translate to Dansk:] Test content 3',
],
];
$queryBuilder = (new ConnectionPool())->getQueryBuilderForTable('tt_content');
......
......@@ -137,6 +137,15 @@ class DataHandler
*/
public $dontProcessTransformations = false;
/**
* Will distinguish between translations (with parent) and localizations (without parent) while still using the same methods to copy the records
* TRUE: translation of a record connected to the default language
* FALSE: localization of a record without connection to the default language
*
* @var bool
*/
protected $useTransOrigPointerField = true;
/**
* TRUE: (traditional) Updates when record is saved. For flexforms, updates if change is made to the localized value.
* FALSE: Will not update anything.
......@@ -3214,6 +3223,11 @@ class DataHandler
$procId = $this->copyMappingArray[$table][$id];
break;
case 'localize':
$this->useTransOrigPointerField = true;
$this->localize($table, $id, $value);
break;
case 'copyToLanguage':
$this->useTransOrigPointerField = false;
$this->localize($table, $id, $value);
break;
case 'inlineLocalizeSynchronize':
......@@ -4487,7 +4501,10 @@ class DataHandler
}
$this->registerNestedElementCall($table, $uid, 'localize');
if ((!$GLOBALS['TCA'][$table]['ctrl']['languageField'] || !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] || $table === 'pages_language_overay') && $table !== 'pages') {
if ((!$GLOBALS['TCA'][$table]['ctrl']['languageField']
|| !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']
|| $table === 'pages_language_overay')
&& $table !== 'pages') {
if ($this->enableLogging) {
$this->newlog('Localization failed; "languageField" and "transOrigPointerField" must be defined for the table!', 1);
}
......@@ -4567,8 +4584,12 @@ class DataHandler
// If the translated record is a default language record, set it's uid as localization parent of the new record.
// If translating from any other language, no override is needed; we just can copy the localization parent of
// the original record (which is pointing to the correspondent default language record) to the new record.
if ($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] === 0 || $table === 'pages') {
// In copy / free mode the TransOrigPointer field is always set to 0, as no connection to the localization parent is wanted in that case.
if (($this->useTransOrigPointerField && (int)$row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] === 0)
|| $table === 'pages') {
$overrideValues[$GLOBALS['TCA'][$Ttable]['ctrl']['transOrigPointerField']] = $uid;
} elseif (!$this->useTransOrigPointerField) {
$overrideValues[$GLOBALS['TCA'][$Ttable]['ctrl']['transOrigPointerField']] = 0;
}
// Copy the type (if defined in both tables) from the original record so that translation has same type as original record
if (isset($GLOBALS['TCA'][$table]['ctrl']['type']) && isset($GLOBALS['TCA'][$Ttable]['ctrl']['type'])) {
......
.. include:: ../../Includes.txt
============================================================
Important: #75400 - New DataHandler command 'copyToLanguage'
============================================================
See :issue:`75400`
Description
===========
A new DataHandler command 'copyToLanguage' has been introduced. It behaves like 'localize' command
(both record and child records are copied to given language), but does not set transOrigPointerField fields (e.g. l10n_parent).
The 'copyToLanguage' command should be used when localizing records in the "Free Mode". This command is used when localizing
content elements using translation wizard's "Copy" strategy.
The 'localize' DataHandler command should be used when translating records in "Connected Mode" (strict translation of records from the default language).
This command is used when selecting "Translate" strategy in content elements translation wizard.
.. index:: PHP-API
\ No newline at end of file
......@@ -87,6 +87,15 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['copiedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see Modify/DataSet/copyContentToLanguage.csv
*/
public function copyContentToLanguage()
{
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see Modify/DataSet/localizeContent.csv
*/
......
......@@ -78,6 +78,28 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\FAL\Abstr
->setTable(self::TABLE_FileReference)->setField('title')->setValues('This is Kasper', 'Taken at T3BOARD'));
}
/**
* @test
* @see DataSet/copyContentToLanguage.csv
*/
public function copyContentToLanguage()
{
parent::copyContentToLanguage();
$this->assertAssertionDataSet('copyContentToLanguage');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
]);
$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'));
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . $this->recordIds['localizedContentId'])->setRecordField(self::FIELD_ContentImage)
->setTable(self::TABLE_FileReference)->setField('title')->setValues('[Translate to Dansk:] This is Kasper', '[Translate to Dansk:] Taken at T3BOARD'));
}
/**
* @test
* @see DataSet/localizeContent.csv
......
sys_file_reference,,,,,,,,,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,uid_local,uid_foreign,tablenames,fieldname,sorting_foreign,table_local,title,description,alternative,link
,126,89,128,0,0,0,0,0,0,0,0,0,1,330,tt_content,image,2,sys_file,T3BOARD,,,
,127,89,64,0,0,0,0,0,0,0,0,0,21,330,tt_content,image,1,sys_file,Kasper,,,
,128,89,32,0,0,0,0,0,0,0,0,0,21,331,tt_content,image,1,sys_file,Taken at T3BOARD,,,
,129,89,16,0,0,0,0,0,0,0,0,0,1,331,tt_content,image,2,sys_file,This is Kasper,,,
,130,89,48,0,1,0,0,0,0,0,0,0,21,332,tt_content,image,1,sys_file,[Translate to Dansk:] Taken at T3BOARD,,,
,131,89,24,0,1,0,0,0,0,0,0,0,1,332,tt_content,image,2,sys_file,[Translate to Dansk:] This is Kasper,,,
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,image,,,,,,,,
,330,89,256,0,0,0,0,0,0,0,0,0,Regular Element #1,2,,,,,,,,
,331,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2,2,,,,,,,,
,332,89,768,0,1,0,331,0,0,0,0,0,[Translate to Dansk:] Regular Element #2,2,,,,,,,,
......@@ -304,6 +304,27 @@ class ActionService
return $this->dataHandler->copyMappingArray;
}
/**
* @param string $tableName
* @param int $uid
* @param int $languageId
* @return array
*/
public function copyRecordToLanguage($tableName, $uid, $languageId)
{
$commandMap = [
$tableName => [
$uid => [
'copyToLanguage' => $languageId,
],
],
];
$this->createDataHandler();
$this->dataHandler->start([], $commandMap);
$this->dataHandler->process_cmdmap();
return $this->dataHandler->copyMappingArray;
}
/**
* @param string $tableName
* @param int $uid
......
......@@ -187,6 +187,26 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['copiedElementId'] = $newTableIds[self::TABLE_Element][self::VALUE_ElementIdFirst];
}
/**
* @test
* @see DataSet/copyContentToLanguageOfRelation.csv
*/
public function copyContentToLanguageOfRelation()
{
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @test
* @see DataSet/copyElementToLanguageOfRelation.csv
*/
public function copyElementToLanguageOfRelation()
{
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Element, self::VALUE_ElementIdFirst, self::VALUE_LanguageId);
$this->recordIds['localizedElementId'] = $newTableIds[self::TABLE_Element][self::VALUE_ElementIdFirst];
}
/**
* @test
* @see DataSet/localizeContentOfRelation.csv
......
......@@ -235,6 +235,42 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\Group\Abs
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1 (copy 1)'));
}
/**
* @test
* @see DataSet/copyContentToLanguageOfRelation.csv
*/
public function copyContentToLanguageOfRelation()
{
parent::copyContentToLanguageOfRelation();
$this->assertAssertionDataSet('copyContentToLanguageOfRelation');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
]);
$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)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #2', 'Element #3'));
}
/**
* @test
* @see DataSet/copyElementToLanguageOfRelation.csv
*/
public function copyElementToLanguageOfRelation()
{
parent::copyElementToLanguageOfRelation();
$this->assertAssertionDataSet('copyElementToLanguageOfRelation');
//in this case the translated element is orphaned (no CE with relation to it, and it has no l10n_parent)
//so on frontend there is no change.
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdFirst)->setRecordField(self::FIELD_ContentElement)
->setTable(self::TABLE_Element)->setField('title')->setValues('Element #1', 'Element #2'));
}
/**
* @test
* @see DataSet/localizeContentOfRelation.csv
......
pages,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,,,
,1,0,256,0,0,0,0,0,0,0,FunctionalTest,,,
,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,,,
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"
,298,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2,"2,3"
,299,89,768,0,1,0,298,0,0,0,0,0,[Translate to Dansk:] Regular Element #2,"2,3"
tx_testdatahandler_element,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,
,1,89,256,0,0,0,0,0,0,0,0,0,Element #1,
,2,89,512,0,0,0,0,0,0,0,0,0,Element #2,
,3,89,768,0,0,0,0,0,0,0,0,0,Element #3,
pages,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,,,
,1,0,256,0,0,0,0,0,0,0,FunctionalTest,,,
,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,,,
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"
,298,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2,"2,3"
tx_testdatahandler_element,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l10n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,
,1,89,256,0,0,0,0,0,0,0,0,0,Element #1,
,2,89,512,0,0,0,0,0,0,0,0,0,Element #2,
,3,89,768,0,0,0,0,0,0,0,0,0,Element #3,
,4,89,384,0,1,0,1,0,0,0,0,0,[Translate to Dansk:] Element #1,
......@@ -98,6 +98,54 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/copyParentContentToLanguageKeep.csv
*/
public function copyParentContentToLanguageInKeepMode()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/copyParentContentToLanguageWAllChildrenKeep.csv
*/
public function copyParentContentToLanguageWithAllChildrenInKeepMode()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'keep';
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/copyParentContentToLanguageSelect.csv
*/
public function copyParentContentToLanguageInSelectMode()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/copyParentContentToLanguageWAllChildrenSelect.csv
*/
public function copyParentContentToLanguageWithAllChildrenInSelectMode()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizationMode'] = 'select';
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = true;
$newTableIds = $this->actionService->copyRecordToLanguage(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/localizeParentContentKeep.csv
*/
......
......@@ -103,6 +103,70 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguageKeep.csv
*/
public function copyParentContentToLanguageInKeepMode()
{
parent::copyParentContentToLanguageInKeepMode();
$this->assertAssertionDataSet('copyParentContentToLanguageKeep');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguageWAllChildrenKeep.csv
*/
public function copyParentContentToLanguageWithAllChildrenInKeepMode()
{
parent::copyParentContentToLanguageWithAllChildrenInKeepMode();
$this->assertAssertionDataSet('copyParentContentToLanguageWAllChildrenKeep');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguageSelect.csv
*/
public function copyParentContentToLanguageInSelectMode()
{
parent::copyParentContentToLanguageInSelectMode();
$this->assertAssertionDataSet('copyParentContentToLanguageSelect');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureDoesNotHaveRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguageWAllChildrenSelect.csv
*/
public function copyParentContentToLanguageWithAllChildrenInSelectMode()
{
parent::copyParentContentToLanguageWithAllChildrenInSelectMode();
$this->assertAssertionDataSet('copyParentContentToLanguageWAllChildrenSelect');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
]);
$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_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
}
/**
* @test
* @see DataSet/localizeParentContentKeep.csv
......
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_irretutorial_1ncsv_hotels
,297,89,256,0,0,0,0,0,0,0,0,0,Regular Element #1,"3,4"
,298,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2,5
,299,89,768,0,1,0,298,0,0,0,0,0,[Translate to Dansk:] Regular Element #2,
tx_irretutorial_1ncsv_hotel,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,offers
,3,89,256,0,0,0,0,0,0,0,0,0,Hotel #1,"5,6"
,4,89,128,0,0,0,0,0,0,0,0,0,Hotel #2,7
,5,89,64,0,0,0,0,0,0,0,0,0,Hotel #1,8
tx_irretutorial_1ncsv_offer,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,prices
,5,89,256,0,0,0,0,0,0,0,0,0,Offer #1.1,"7,8,9"
,6,89,128,0,0,0,0,0,0,0,0,0,Offer #1.2,"10,11"
,7,89,64,0,0,0,0,0,0,0,0,0,Offer #2.1,12
,8,89,32,0,0,0,0,0,0,0,0,0,Offer #1.1,13
tx_irretutorial_1ncsv_price,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,
,7,89,256,0,0,0,0,0,0,0,0,0,Price #1.1.1,
,8,89,128,0,0,0,0,0,0,0,0,0,Price #1.1.2,
,9,89,64,0,0,0,0,0,0,0,0,0,Price #1.1.3,
,10,89,32,0,0,0,0,0,0,0,0,0,Price #1.2.1,
,11,89,16,0,0,0,0,0,0,0,0,0,Price #1.2.2,
,12,89,8,0,0,0,0,0,0,0,0,0,Price #2.1.1,
,13,89,4,0,0,0,0,0,0,0,0,0,Price #1.1.1,
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_irretutorial_1ncsv_hotels
,297,89,256,0,0,0,0,0,0,0,0,0,Regular Element #1,"3,4"
,298,89,512,0,0,0,0,0,0,0,0,0,Regular Element #2,5
,299,89,768,0,1,0,298,0,0,0,0,0,[Translate to Dansk:] Regular Element #2,
tx_irretutorial_1ncsv_hotel,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,offers
,3,89,256,0,0,0,0,0,0,0,0,0,Hotel #1,"5,6"
,4,89,128,0,0,0,0,0,0,0,0,0,Hotel #2,7
,5,89,64,0,0,0,0,0,0,0,0,0,Hotel #1,8
tx_irretutorial_1ncsv_offer,,,,,,,,,,,,,,
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,prices
,5,89,256,0,0,0,0,0,0,0,0,0,Offer #1.1,"7,8,9"
,6,89,128,0,0,0,0,0,0,0,0,0,Offer #1.2,"10,11"