diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php index e5cff4a827c8..298cab720435 100644 --- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php +++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php @@ -4640,10 +4640,10 @@ public function moveRecord_raw($table, $uid, $destPid) // Save the position to which the original record is requested to be moved $originalRecordDestinationPid = $destPid; $sortInfo = $this->getSortNumber($table, $uid, $destPid); - // Setting the destPid to the new pid of the record. - $destPid = $sortInfo['pid']; // If not an array, there was an error (which is already logged) if (is_array($sortInfo)) { + // Setting the destPid to the new pid of the record. + $destPid = $sortInfo['pid']; if ($table !== 'pages' || $this->destNotInsideSelf($destPid, $uid)) { // clear cache before moving $this->registerRecordIdForPageCacheClearing($table, $uid);