Commit 8f64dc55 authored by Benni Mack's avatar Benni Mack
Browse files

[!!!][TASK] IRRE: Always consider "localizeChildrenAtParentLocalization"

The TCA Inline behaviour option "localizeChildrenAtParentLocalization" is dropped.
This functionality is now always enabled.

A TCA migration wizard is removing the option.

On a side note, the removed functional tests when removing
"localizationMode=select" were re-added.

Resolves: #82709
Releases: master
Change-Id: Idad3443417bf08fc4c93fa6475079ac2fd779c1e
Reviewed-on: https://review.typo3.org/54326


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Reviewed-by: default avatarDaniel Gorges <daniel.gorges@b13.de>
Tested-by: default avatarDaniel Gorges <daniel.gorges@b13.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 97558734
......@@ -3159,9 +3159,7 @@ class DataHandler
*/
protected function checkValue_inline_processDBdata($valueArray, $tcaFieldConf, $id, $status, $table, $field, array $additionalData = null)
{
$newValue = '';
$foreignTable = $tcaFieldConf['foreign_table'];
$transOrigPointer = 0;
$valueArray = $this->applyFiltersToValues($tcaFieldConf, $valueArray);
// Fetch the related child records using \TYPO3\CMS\Core\Database\RelationHandler
/** @var $dbAnalysis RelationHandler */
......@@ -3174,17 +3172,15 @@ class DataHandler
// update record in intermediate table (sorting & pointer uid to parent record)
$dbAnalysis->writeForeignField($tcaFieldConf, $id, 0, $skipSorting);
$newValue = $dbAnalysis->countItems(false);
} elseif ($this->getInlineFieldType($tcaFieldConf) === 'mm') {
// In order to fully support all the MM stuff, directly call checkValue_group_select_processDBdata instead of repeating the needed code here
$valueArray = $this->checkValue_group_select_processDBdata($valueArray, $tcaFieldConf, $id, $status, 'select', $table, $field);
$newValue = $valueArray[0];
} else {
if ($this->getInlineFieldType($tcaFieldConf) === 'mm') {
// In order to fully support all the MM stuff, directly call checkValue_group_select_processDBdata instead of repeating the needed code here
$valueArray = $this->checkValue_group_select_processDBdata($valueArray, $tcaFieldConf, $id, $status, 'select', $table, $field);
$newValue = $valueArray[0];
} else {
$valueArray = $dbAnalysis->getValueArray();
// Checking that the number of items is correct:
$valueArray = $this->checkValue_checkMax($tcaFieldConf, $valueArray);
$newValue = $this->castReferenceValue(implode(',', $valueArray), $tcaFieldConf);
}
$valueArray = $dbAnalysis->getValueArray();
// Checking that the number of items is correct:
$valueArray = $this->checkValue_checkMax($tcaFieldConf, $valueArray);
$newValue = $this->castReferenceValue(implode(',', $valueArray), $tcaFieldConf);
}
return $newValue;
}
......@@ -3861,13 +3857,11 @@ class DataHandler
$prependName = $conf['type'] === 'group' ? $conf['prepend_tname'] : '';
$mmTable = isset($conf['MM']) && $conf['MM'] ? $conf['MM'] : '';
$localizeForeignTable = isset($conf['foreign_table']) && BackendUtility::isTableLocalizable($conf['foreign_table']);
$localizeReferences = $localizeForeignTable && isset($conf['localizeReferencesAtParentLocalization']) && $conf['localizeReferencesAtParentLocalization'];
$localizeChildren = $localizeForeignTable && isset($conf['behaviour']['localizeChildrenAtParentLocalization']) && $conf['behaviour']['localizeChildrenAtParentLocalization'];
// Localize referenced records of select fields:
$localizingNonManyToManyFieldReferences = empty($mmTable) && $localizeForeignTable && isset($conf['localizeReferencesAtParentLocalization']) && $conf['localizeReferencesAtParentLocalization'];
/** @var $dbAnalysis RelationHandler */
$dbAnalysis = $this->createRelationHandlerInstance();
$dbAnalysis->start($value, $allowedTables, $mmTable, $uid, $table, $conf);
// Localize referenced records of select fields:
$localizingNonManyToManyFieldReferences = $localizeReferences && empty($mmTable);
$purgeItems = false;
if ($language > 0 && $localizingNonManyToManyFieldReferences) {
foreach ($dbAnalysis->itemArray as $index => $item) {
......@@ -3876,11 +3870,7 @@ class DataHandler
if ($recordLocalization) {
$dbAnalysis->itemArray[$index]['id'] = $recordLocalization[0]['uid'];
} elseif ($this->isNestedElementCallRegistered($item['table'], $item['id'], 'localize') === false) {
if ($localizingNonManyToManyFieldReferences || $localizeChildren) {
$dbAnalysis->itemArray[$index]['id'] = $this->localize($item['table'], $item['id'], $language);
} else {
unset($dbAnalysis->itemArray[$index]);
}
$dbAnalysis->itemArray[$index]['id'] = $this->localize($item['table'], $item['id'], $language);
}
}
$purgeItems = true;
......@@ -3934,10 +3924,8 @@ class DataHandler
$newId = null;
// If language is set and differs from original record, this isn't a copy action but a localization of our parent/ancestor:
if ($language > 0 && BackendUtility::isTableLocalizable($table) && $language != $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]) {
// If children should be localized when the parent gets localized the first time, just do it:
if (isset($conf['behaviour']['localizeChildrenAtParentLocalization']) && $conf['behaviour']['localizeChildrenAtParentLocalization']) {
$newId = $this->localize($v['table'], $v['id'], $language);
}
// Children should be localized when the parent gets localized the first time, just do it:
$newId = $this->localize($v['table'], $v['id'], $language);
} else {
if (!MathUtility::canBeInterpretedAsInteger($realDestPid)) {
$newId = $this->copyRecord($v['table'], $v['id'], -$v['id']);
......
......@@ -87,6 +87,7 @@ class TcaMigration
$tca = $this->migrateImageManipulationConfig($tca);
$tca = $this->migrateinputDateTimeMax($tca);
$tca = $this->migrateInlineOverrideChildTca($tca);
$tca = $this->migrateLocalizeChildrenAtParentLocalization($tca);
return $tca;
}
......@@ -2505,4 +2506,43 @@ class TcaMigration
return $tca;
}
/**
* Option $TCA[$table]['columns'][$columnName]['config']['behaviour']['localizeChildrenAtParentLocalization']
* is always on, so this option can be removed.
*
* @param array $tca
* @return array the modified TCA structure
*/
protected function migrateLocalizeChildrenAtParentLocalization(array $tca): array
{
foreach ($tca as $table => &$tableDefinition) {
if (!isset($tableDefinition['columns']) || !is_array($tableDefinition['columns'])) {
continue;
}
foreach ($tableDefinition['columns'] as $fieldName => &$fieldConfig) {
if (($fieldConfig['config']['type'] ?? null) !== 'inline') {
continue;
}
$localizeChildrenAtParentLocalization = ($fieldConfig['config']['behaviour']['localizeChildrenAtParentLocalization'] ?? null);
if ($localizeChildrenAtParentLocalization === null) {
continue;
}
if ($localizeChildrenAtParentLocalization) {
$this->messages[] = 'The TCA setting \'localizeChildrenAtParentLocalization\' is deprecated '
. ' and should be removed from TCA for ' . $table . '[\'columns\']'
. '[\'' . $fieldName . '\'][\'config\'][\'behaviour\'][\'localizeChildrenAtParentLocalization\']';
} else {
$this->messages[] = 'The TCA setting \'localizeChildrenAtParentLocalization\' is deprecated '
. ', as this functionality is always enabled. The option should be removed from TCA for '
. $table . '[\'columns\'][\'' . $fieldName . '\'][\'config\'][\'behaviour\']'
. '[\'localizeChildrenAtParentLocalization\']';
}
unset($fieldConfig['config']['behaviour']['localizeChildrenAtParentLocalization']);
}
}
return $tca;
}
}
......@@ -576,10 +576,7 @@ class ExtensionManagementUtility
'hide' => true,
'delete' => true,
],
],
'behaviour' => [
'localizeChildrenAtParentLocalization' => true,
],
]
];
ArrayUtility::mergeRecursiveWithOverrule($fileFieldTCAConfig, $customSettingOverride);
return $fileFieldTCAConfig;
......
.. include:: ../../Includes.txt
============================================================================
Breaking: #82709 - TCA option "localizeChildrenAtParentLocalization" removed
============================================================================
See :issue:`82709`
Description
===========
The TCA option `$TCA[$tableName]['columns'][$columnName]['config']['behaviour']['localizeChildrenAtParentLocalization']`
has been removed, as this is the default behaviour for any kind of inline translation (IRRE).
The behaviour to disable this functionality in TYPO3 v8 was not compatible anymore with any
localization mode setting and the newly introduced `allowLanguageSynchronization`.
Impact
======
Explicitly disabling this option has no effect anymore, setting this option in TCA will
trigger a deprecation message.
Affected Installations
======================
Any installation with custom TCA definitions of Inline Relational Record Editing which have this
setting set.
Migration
=========
Remove the TCA option in the extensions' TCA definition.
.. index:: TCA, NotScanned
\ No newline at end of file
......@@ -99,11 +99,28 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['newContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/copyParentContentToLanguage.csv
* Should copy all children as well
*/
public function copyParentContentToLanguage()
{
$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/localizeParentContentWAllChildren.csv
* Should localize all children as well
*/
public function localizeParentContentWithAllChildren()
{
$newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
public function localizeParentContentWithLanguageSynchronization()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$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->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
$this->actionService->modifyRecords(
......
......@@ -103,6 +103,40 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\CSV\
->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguage.csv
*/
public function copyParentContentToLanguageWithAllChildren()
{
parent::copyParentContentToLanguage();
$this->assertAssertionDataSet('copyParentContentToLanguage');
$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/localizeParentContentWAllChildren.csv
*/
public function localizeParentContentWithAllChildren()
{
parent::localizeParentContentWithAllChildren();
$this->assertAssertionDataSet('localizeParentContentWAllChildren');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections();
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->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/localizeParentContentLanguageSynchronization.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,6
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
,6,89,96,0,1,0,5,0,0,0,0,0,[Translate to Dansk:] Hotel #1,9
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
,9,89,48,0,1,0,8,0,0,0,0,0,[Translate to Dansk:] Offer #1.1,14
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,
,14,89,6,0,1,0,13,0,0,0,0,0,[Translate to Dansk:] 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,298,298,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",6
"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
,6,89,96,0,1,5,5,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",9
"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
,9,89,48,0,1,8,8,0,0,0,0,0,"[Translate to Dansk:] Offer #1.1",14
"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",
,14,89,6,0,1,13,13,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.1",
......@@ -117,11 +117,8 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
*/
public function localizeParentContentWithLanguageSynchronization()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['allowLanguageSynchronization'] = true;
$GLOBALS['TCA'][self::TABLE_Offer]['columns'][self::FIELD_OfferPrice]['config']['behaviour']['localizeChildrenAtParentLocalization'] = false;
$GLOBALS['TCA'][self::TABLE_Offer]['columns'][self::FIELD_OfferPrice]['config']['behaviour']['allowLanguageSynchronization'] = true;
$newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
......@@ -133,8 +130,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
public function localizeParentContentChainLanguageSynchronizationSource()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$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->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentIdFirst'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
$newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, $this->recordIds['localizedContentIdFirst'], self::VALUE_LanguageIdSecond);
......@@ -153,6 +148,24 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
);
}
/**
* @see DataSet/copyParentContentToLanguageWAllChildren.csv
*/
public function copyParentContentToLanguageWithAllChildren()
{
$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/localizeParentContentWAllChildren.csv
*/
public function localizeParentContentWithAllChildren()
{
$newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
}
/**
* @see DataSet/Modify/localizeParentContentNCreateNestedChildrenWLanguageSynchronization.csv
*/
......@@ -188,28 +201,6 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
$this->recordIds['newPriceId'] = $this->actionService->getDataHandler()->substNEWwithIDs[$newPriceId];
}
public function localizeChildrenHavingStandaloneChildrenInSelectModeAndLanguageSynchronization()
{
$GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
unset($GLOBALS['TCA'][self::TABLE_Content]['columns'][self::FIELD_ContentHotel]['config']['behaviour']['localizeChildrenAtParentLocalization']);
unset($GLOBALS['TCA'][self::TABLE_Hotel]['columns'][self::FIELD_HotelOffer]['config']['behaviour']['localizeChildrenAtParentLocalization']);
$this->actionService->createNewRecords(self::VALUE_PageId, [
self::TABLE_Hotel => ['title' => 'Hotel Standalone', 'parenttable' => 'tt_content'],
self::TABLE_Offer => ['title' => 'Offer Standalone', 'parenttable' => 'tt_content'],
]);
$newTableIds = $this->actionService->localizeRecord(self::TABLE_Content, self::VALUE_ContentIdLast, self::VALUE_LanguageId);
$this->recordIds['localizedContentId'] = $newTableIds[self::TABLE_Content][self::VALUE_ContentIdLast];
$this->actionService->modifyRecords(
self::VALUE_PageId,
[
self::TABLE_Content => ['uid' => self::VALUE_ContentIdLast, self::FIELD_ContentHotel => '5,__nextUid'],
self::TABLE_Hotel => ['uid' => '__NEW', 'title' => 'Hotel #2'],
]
);
}
/**
* @see DataSet/changeParentContentRecordSorting.csv
*/
......
......@@ -103,6 +103,41 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
->setTable(self::TABLE_Hotel)->setField('title')->setValues('Hotel #1'));
}
/**
* @test
* @see DataSet/copyParentContentToLanguageWAllChildren.csv
*/
public function copyParentContentToLanguageWithAllChildren()
{
parent::copyParentContentToLanguageWithAllChildren();
$this->assertAssertionDataSet('copyParentContentToLanguageWAllChildren');
$this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRenderer.ts',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/ExtbaseJsonRenderer.ts',
'typo3/sysext/core/Tests/Functional/Fixtures/Frontend/JsonRendererNoOverlay.ts'
]);
$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)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1'));
}
/**
* @test
* @see DataSet/localizeParentContentWAllChildren.csv
*/
public function localizeParentContentWithAllChildren()
{
parent::localizeParentContentWithAllChildren();
$this->assertAssertionDataSet('localizeParentContentWAllChildren');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->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/localizeParentContentSynchronization.csv
......@@ -148,22 +183,6 @@ class ActionTest extends \TYPO3\CMS\Core\Tests\Functional\DataHandling\IRRE\Fore
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1', '[Translate to Dansk:] New Hotel #1'));
}
/**
* @test
* @see DataSet/localizeChildrenHStandaloneChildrenLanguageSynchronization.csv
* @see https://forge.typo3.org/issues/81915
*/
public function localizeChildrenHavingStandaloneChildrenLanguageSynchronization()
{
parent::localizeChildrenHavingStandaloneChildrenInSelectModeAndLanguageSynchronization();
$this->assertAssertionDataSet('locChildrenHStandaloneChildrenLanguageSynch');
$responseSections = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseSections('Default', 'Extbase:list()');
$this->assertThat($responseSections, $this->getRequestSectionStructureHasRecordConstraint()
->setRecordIdentifier(self::TABLE_Content . ':' . self::VALUE_ContentIdLast)->setRecordField(self::FIELD_ContentHotel)
->setTable(self::TABLE_Hotel)->setField('title')->setValues('[Translate to Dansk:] Hotel #1', '[Translate to Dansk:] Hotel #2'));
}
/**
* @test
* @see DataSet/changeParentContentRecordSorting.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_1nff_hotels
,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1",2
,298,89,512,0,0,0,0,0,0,0,0,0,"Regular Element #2",1
,299,89,768,0,1,0,298,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",1
tx_irretutorial_1nff_hotel
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
,2,89,512,0,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
,3,89,768,0,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
,4,89,1536,0,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
,5,89,1024,0,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
,6,89,1,0,1,0,5,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",299,tt_content,,1
tx_irretutorial_1nff_offer
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
,5,89,512,0,0,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
,6,89,1536,0,0,0,0,0,0,0,0,0,"Offer #1.2",3,tx_irretutorial_1nff_hotel,,2
,7,89,768,0,0,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
,8,89,1024,0,0,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
,9,89,1,0,1,0,8,0,0,0,0,0,"[Translate to Dansk:] Offer #1.1",6,tx_irretutorial_1nff_hotel,,1
tx_irretutorial_1nff_price
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier
,7,89,512,0,0,0,0,0,0,0,0,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
,8,89,1792,0,0,0,0,0,0,0,0,0,"Price #1.1.2",5,tx_irretutorial_1nff_offer,
,9,89,2304,0,0,0,0,0,0,0,0,0,"Price #1.1.3",5,tx_irretutorial_1nff_offer,
,10,89,768,0,0,0,0,0,0,0,0,0,"Price #1.2.1",6,tx_irretutorial_1nff_offer,
,11,89,2048,0,0,0,0,0,0,0,0,0,"Price #1.2.2",6,tx_irretutorial_1nff_offer,
,12,89,1024,0,0,0,0,0,0,0,0,0,"Price #2.1.1",7,tx_irretutorial_1nff_offer,
,13,89,1280,0,0,0,0,0,0,0,0,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,
,14,89,1,0,1,0,13,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.1",9,tx_irretutorial_1nff_offer,
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_1nff_hotels,l10n_state
,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1",2,
,298,89,512,0,0,0,0,0,0,0,0,0,"Regular Element #2",2,
,299,89,768,0,1,298,298,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",2,"{""tx_irretutorial_1nff_hotels"":""parent""}"
,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_1nff_hotels
,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1",2
,298,89,512,0,0,0,0,0,0,0,0,0,"Regular Element #2",1
,299,89,768,0,1,298,298,0,0,0,0,0,"[Translate to Dansk:] Regular Element #2",1
tx_irretutorial_1nff_hotel
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,offers
,2,89,1280,0,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
,3,89,1536,0,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
,4,89,2048,0,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
,5,89,1,0,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
,6,89,1024,0,0,0,0,0,0,0,0,0,"Hotel Standalone",0,tt_content,,0
,7,89,1,0,1,5,5,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",299,tt_content,,0
,8,89,2,0,0,0,0,0,0,0,0,0,"Hotel #2",298,tt_content,,0
,9,89,2,0,1,8,0,0,0,0,0,0,"[Translate to Dansk:] Hotel #2",299,tt_content,,0
,2,89,512,0,0,0,0,0,0,0,0,0,"Hotel #0",89,pages,,0
,3,89,768,0,0,0,0,0,0,0,0,0,"Hotel #1",297,tt_content,,2
,4,89,1536,0,0,0,0,0,0,0,0,0,"Hotel #2",297,tt_content,,1
,5,89,1024,0,0,0,0,0,0,0,0,0,"Hotel #1",298,tt_content,,1
,6,89,1,0,1,5,5,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",299,tt_content,,1
tx_irretutorial_1nff_offer
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier,prices
,5,89,1,0,0,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
,6,89,2,0,0,0,0,0,0,0,0,0,"Offer #1.2",3,tx_irretutorial_1nff_hotel,,2
,7,89,1,0,0,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
,8,89,1,0,0,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
,9,89,0,0,0,0,0,0,0,0,0,0,"Offer Standalone",0,tt_content,,0
,5,89,512,0,0,0,0,0,0,0,0,0,"Offer #1.1",3,tx_irretutorial_1nff_hotel,,3
,6,89,1536,0,0,0,0,0,0,0,0,0,"Offer #1.2",3,tx_irretutorial_1nff_hotel,,2
,7,89,768,0,0,0,0,0,0,0,0,0,"Offer #2.1",4,tx_irretutorial_1nff_hotel,,1
,8,89,1024,0,0,0,0,0,0,0,0,0,"Offer #1.1",5,tx_irretutorial_1nff_hotel,,1
,9,89,1,0,1,8,8,0,0,0,0,0,"[Translate to Dansk:] Offer #1.1",6,tx_irretutorial_1nff_hotel,,1
tx_irretutorial_1nff_price
,uid,pid,sorting,deleted,sys_language_uid,l18n_parent,t3_origuid,t3ver_wsid,t3ver_state,t3ver_stage,t3ver_oid,t3ver_move_id,title,parentid,parenttable,parentidentifier
,7,89,1,0,0,0,0,0,0,0,0,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
,8,89,2,0,0,0,0,0,0,0,0,0,"Price #1.1.2",5,tx_irretutorial_1nff_offer,
,9,89,3,0,0,0,0,0,0,0,0,0,"Price #1.1.3",5,tx_irretutorial_1nff_offer,
,10,89,1,0,0,0,0,0,0,0,0,0,"Price #1.2.1",6,tx_irretutorial_1nff_offer,
,11,89,2,0,0,0,0,0,0,0,0,0,"Price #1.2.2",6,tx_irretutorial_1nff_offer,
,12,89,1,0,0,0,0,0,0,0,0,0,"Price #2.1.1",7,tx_irretutorial_1nff_offer,
,13,89,1,0,0,0,0,0,0,0,0,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,
,7,89,512,0,0,0,0,0,0,0,0,0,"Price #1.1.1",5,tx_irretutorial_1nff_offer,
,8,89,1792,0,0,0,0,0,0,0,0,0,"Price #1.1.2",5,tx_irretutorial_1nff_offer,
,9,89,2304,0,0,0,0,0,0,0,0,0,"Price #1.1.3",5,tx_irretutorial_1nff_offer,
,10,89,768,0,0,0,0,0,0,0,0,0,"Price #1.2.1",6,tx_irretutorial_1nff_offer,
,11,89,2048,0,0,0,0,0,0,0,0,0,"Price #1.2.2",6,tx_irretutorial_1nff_offer,
,12,89,1024,0,0,0,0,0,0,0,0,0,"Price #2.1.1",7,tx_irretutorial_1nff_offer,
,13,89,1280,0,0,0,0,0,0,0,0,0,"Price #1.1.1",8,tx_irretutorial_1nff_offer,
,14,89,1,0,1,13,13,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.1",9,tx_irretutorial_1nff_offer,
......@@ -48,9 +48,6 @@
<showPossibleLocalizationRecords>1</showPossibleLocalizationRecords>
<showRemovedLocalizationRecords>1</showRemovedLocalizationRecords>
</appearance>
<behaviour type="array">
<localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
</behaviour>
</config>
</TCEforms>
</files>
......
......@@ -24,9 +24,6 @@ $GLOBALS['TCA']['tt_content']['ctrl']['shadowColumnsForMovePlaceholders'] = 'tx_