[BUGFIX] Fix translation moving in workspaces
authorTolleiv Nietsch <info@tolleiv.de>
Sun, 12 Feb 2012 04:58:25 +0000 (05:58 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Mon, 13 Feb 2012 21:15:25 +0000 (22:15 +0100)
Seems that the API changes introduced with changeset 89bd701c
haven't been made everywhere. This caused some issue when
translated records are move in a workspace.

Goes together with a fix in t3lib_tcemain which will follow.

Change-Id: If5aed1814e33664fcea0e11f10a48779a0e43bc9
Fixes: #33592
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/8997
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Philipp Gampe
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
typo3/sysext/version/class.tx_version_tcemain.php

index ea53c0f..f148593 100644 (file)
@@ -1322,7 +1322,8 @@ class tx_version_tcemain {
         */
        protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, t3lib_TCEmain $tcemainObj) {
                        // If a record gets moved after a record that already has a placeholder record
-                       // then the new placeholder record needs to be after the existing one:
+                       // then the new placeholder record needs to be after the existing one
+               $originalRecordDestinationPid = $destPid;
                if ($destPid < 0) {
                        $movePlaceHolder = t3lib_BEfunc::getMovePlaceholder($table, abs($destPid), 'uid');
 
@@ -1376,7 +1377,6 @@ class tx_version_tcemain {
                                $newVersion_placeholderFieldArray[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] = $l10nParentRec[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']];
                                unset($l10nParentRec);
                        }
-
                                // Initially, create at root level.
                        $newVersion_placeholderFieldArray['pid'] = 0;
                        $id = 'NEW_MOVE_PLH';
@@ -1395,7 +1395,7 @@ class tx_version_tcemain {
                }
 
                        // Check for the localizations of that element and move them as well
-               $tcemainObj->moveL10nOverlayRecords($table, $uid, $destPid);
+               $tcemainObj->moveL10nOverlayRecords($table, $uid, $destPid, $originalRecordDestinationPid);
        }
 
        /**