[BUGFIX] Do not re-sort IRRE children when sorting parent
[Packages/TYPO3.CMS.git] / typo3 / sysext / workspaces / Classes / Hook / DataHandlerHook.php
index 87637d3..bf7f4b8 100644 (file)
@@ -343,10 +343,14 @@ class DataHandlerHook
             if (empty($WSversion['uid'])) {
                 $dataHandler->versionizeRecord($table, $uid, 'MovePointer');
                 $WSversion = BackendUtility::getWorkspaceVersionOfRecord($dataHandler->BE_USER->workspace, $table, $uid, 'uid,t3ver_oid');
-                $this->moveRecord_processFields($dataHandler, $resolvedPid, $table, $uid);
+                if ((int)$resolvedPid !== (int)$propArr['pid']) {
+                    $this->moveRecord_processFields($dataHandler, $resolvedPid, $table, $uid);
+                }
             } elseif ($dataHandler->isRecordCopied($table, $uid) && (int)$dataHandler->copyMappingArray[$table][$uid] === (int)$WSversion['uid']) {
                 // If the record has been versioned before (e.g. cascaded parent-child structure), create only the move-placeholders
-                $this->moveRecord_processFields($dataHandler, $resolvedPid, $table, $uid);
+                if ((int)$resolvedPid !== (int)$propArr['pid']) {
+                    $this->moveRecord_processFields($dataHandler, $resolvedPid, $table, $uid);
+                }
             }
         }
         // Check workspace permissions: