Index: t3lib/class.t3lib_tcemain.php =================================================================== --- t3lib/class.t3lib_tcemain.php (revision 5717) +++ t3lib/class.t3lib_tcemain.php (working copy) @@ -3464,6 +3464,9 @@ $updateFields['t3ver_state'] = 4; // Setting placeholder state value for version (so it can know it is currently a new version...) $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($wsUid), $updateFields); } + + //check for the localizations of that element and move them as well + $this->moveL10nOverlayRecords($table,$uid,$destPid); } /** @@ -3521,6 +3524,8 @@ $this->moveRecord_procFields($table,$uid,$destPid); // Create query for update: $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($uid), $updateFields); + // check for the localizations of that element + $this->moveL10nOverlayRecords($table,$uid,$destPid); // Call post processing hooks: foreach($hookObjectsArr as $hookObj) { @@ -3564,6 +3569,8 @@ $this->moveRecord_procFields($table,$uid,$destPid); // Create query for update: $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid='.intval($uid), $updateFields); + // check for the localizations of that element + $this->moveL10nOverlayRecords($table,$uid,$destPid); // Call post processing hooks: foreach($hookObjectsArr as $hookObj) { @@ -3660,6 +3667,27 @@ } /** + * Find l10n-overlay records and perform the requested move action for these records. + * + * @param string $table: Record Table + * @param string $uid: Record UID + * @param string $destPid: Position to move to + * @return void + */ + function moveL10nOverlayRecords($table,$uid,$destPid) { + //there's no need to perform this for table-records + if( $table == 'pages' ) return; + t3lib_div::loadTCA( $table ); + + $l10nRecords = t3lib_BEfunc::getRecordsByField( $table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid ); + if( is_array($l10nRecords) ) { + foreach( $l10nRecords as $record ) { + $this->moveRecord( $table, $record['uid'], $destPid ); + } + } + } + + /** * Localizes a record to another system language * In reality it only works if transOrigPointerTable is not set. For "pages" the implementation is hardcoded * @@ -4531,6 +4559,10 @@ if ($TCA[$table]['ctrl']['sortby']) { $keepFields[] = $TCA[$table]['ctrl']['sortby']; } + // l10n-fields must be kept otherwise the localization will be lost during the publishing + if ( $TCA[$table]['ctrl']['transOrigPointerField'] ) { + $keepFields[] = $TCA[$table]['ctrl']['transOrigPointerField']; + } // Swap "keepfields" foreach($keepFields as $fN) {