diff --git a/typo3/sysext/core/Classes/Migrations/TcaMigration.php b/typo3/sysext/core/Classes/Migrations/TcaMigration.php index fa032094028fa8f636647ed441b0571b73c3f3a9..eaf0a959039a1a268e11cca8df7474746b621611 100644 --- a/typo3/sysext/core/Classes/Migrations/TcaMigration.php +++ b/typo3/sysext/core/Classes/Migrations/TcaMigration.php @@ -57,6 +57,7 @@ class TcaMigration $tca = $this->migrateTSconfigSoftReferences($tca); $tca = $this->migrateShowIfRteOption($tca); $tca = $this->migrateWorkspacesOptions($tca); + $tca = $this->migrateTranslationTable($tca); // @todo: if showitem/defaultExtras wizards[xy] is migrated to columnsOverrides here, enableByTypeConfig could be dropped return $tca; } @@ -872,4 +873,28 @@ class TcaMigration } return $tca; } + + /** + * Removes "transForeignTable" and "transOrigPointerTable" which has been + * used for tables "pages" and "pages_languages_overlay" in the core only. + * + * @param array $tca + * @return array Migrated TCA + */ + protected function migrateTranslationTable(array $tca) + { + foreach ($tca as $table => &$tableDefinition) { + if (!empty($tableDefinition['ctrl']['transForeignTable'])) { + unset($tableDefinition['ctrl']['transForeignTable']); + $this->messages[] = 'The TCA setting \'transForeignTable\' was removed ' + . 'in TCA ' . $table . '[\'ctrl\'][\'transForeignTable\']'; + } + if (!empty($tableDefinition['ctrl']['transOrigPointerTable'])) { + unset($tableDefinition['ctrl']['transOrigPointerTable']); + $this->messages[] = 'The TCA setting \'transOrigPointerTable\' was removed ' + . 'in TCA ' . $table . '[\'ctrl\'][\'transOrigPointerTable\']'; + } + } + return $tca; + } } diff --git a/typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php b/typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php index 44ac22467856514120d63296b92a0f1f537691e3..fbdef39885ceba4661670c507fa49bb8822f9ccd 100644 --- a/typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php +++ b/typo3/sysext/core/Tests/Unit/Migrations/TcaMigrationTest.php @@ -1865,4 +1865,53 @@ class TcaMigrationTest extends UnitTestCase $subject = new TcaMigration(); $this->assertEquals($expectedConfig, $subject->migrate($givenConfig)); } + + /** + * @return array + */ + public function migrateTranslationTableDataProvider() + { + return [ + 'remove transForeignTable' => [ + [ + 'aTable' => [ + 'ctrl' => [ + 'transForeignTable' => 'pages_language_overlay', + ], + ], + ], + [ + 'aTable' => [ + 'ctrl' => [], + ], + ] + ], + 'remove transOrigPointerTable' => [ + [ + 'aTable' => [ + 'ctrl' => [ + 'transOrigPointerTable' => 'pages', + ], + ], + ], + [ + 'aTable' => [ + 'ctrl' => [], + ], + ] + ] + ]; + } + + /** + * @param array $givenConfig + * @param array $expectedConfig + * @test + * @dataProvider migrateTranslationTableDataProvider + */ + public function migrateTranslationTable(array $givenConfig, array $expectedConfig) + { + $subject = new TcaMigration(); + $this->assertEquals($expectedConfig, $subject->migrate($givenConfig)); + } }