} else {
// Create new page which needs to contain the same pid as the original page
$overrideValues['pid'] = $row['pid'];
+ // Take over the hidden state of the original language state, this is done due to legacy reasons where-as
+ // pages_language_overlay was set to "hidden -> default=0" but pages hidden -> default 1"
+ if (!empty($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'])) {
+ $hiddenFieldName = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
+ $overrideValues[$hiddenFieldName] = $row[$hiddenFieldName] ?? $GLOBALS['TCA'][$table]['columns'][$hiddenFieldName]['config']['default'];
+ }
$temporaryId = StringUtility::getUniqueId('NEW');
$copyTCE = $this->getLocalTCE();
$copyTCE->start([$table => [$temporaryId => $overrideValues]], [], $this->BE_USER);
// Getting the new UID as if it had been copied:
$theNewSQLID = $copyTCE->substNEWwithIDs[$temporaryId];
if ($theNewSQLID) {
- // If is by design that $table is used and not $table! See "l10nmgr" extension. Could be debated, but this is what I chose for this "pseudo case"
$this->copyMappingArray[$table][$uid] = $theNewSQLID;
$newId = $theNewSQLID;
}
public function localizePageWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageTwiceWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageIdFirst'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
public function localizePageAndAddHotelChildWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->actionService->modifyRecords(
public function localizePageWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageAndAddHotelChildWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['languageField']);
unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['transOrigPointerField']);
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
public function localizeAndCopyPageWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageWithSynchronizationAndCustomLocalizedHotel()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
public function localizePageTwiceWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageIdFirst'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageIdSecond);
public function localizePageAndAddHotelChildWithLocalizationExclude()
{
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['l10n_mode'] = 'exclude';
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->actionService->modifyRecords(
public function localizePageWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageAndAddHotelChildWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageAndAddMonoglotHotelChildWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['languageField']);
unset($GLOBALS['TCA'][self::TABLE_Hotel]['ctrl']['transOrigPointerField']);
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
public function localizeAndCopyPageWithLanguageSynchronization()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
public function localizePageWithSynchronizationAndCustomLocalizedHotel()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$GLOBALS['TCA'][self::TABLE_Page]['columns'][self::FIELD_PageHotel]['config']['behaviour']['allowLanguageSynchronization'] = true;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
*/
public function localizePage()
{
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
}
{
unset($GLOBALS['TCA'][self::TABLE_Page]['columns']['title']['l10n_mode']);
$GLOBALS['TCA'][self::TABLE_Page]['columns']['title']['config']['behaviour']['allowLanguageSynchronization'] = true;
- // in these test cases we expect new pages not to be hidden in order to
- // verify proper overlaying behavior during the frontend render process
- $GLOBALS['TCA'][self::TABLE_Page]['columns']['hidden']['config']['default'] = 0;
$localizedTableIds = $this->actionService->localizeRecord(self::TABLE_Page, self::VALUE_PageId, self::VALUE_LanguageId);
$this->recordIds['localizedPageId'] = $localizedTableIds[self::TABLE_Page][self::VALUE_PageId];
$this->actionService->modifyRecord(self::TABLE_Page, self::VALUE_PageId, ['title' => 'Testing #1']);