From ff91d3d52ff28bf1f7f2c93694a3e1556f0d9474 Mon Sep 17 00:00:00 2001 From: Thomas Hohn Date: Mon, 7 Aug 2023 10:20:05 +0200 Subject: [PATCH] [BUGFIX] Fix PHP 8 warnings in DataHandler Moved assignment of $destPid = $sortInfo['pid'] after check if $sortInfo is an array, since the method call to getSortNumber can return other values than an array. Resolves: #101606 Releases: main, 12.4, 11.5 Change-Id: I3cfef35b351a0cd1fa8197702cce9e3b05871fcf Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80431 Tested-by: Christian Kuhn Tested-by: core-ci Reviewed-by: Christian Kuhn --- typo3/sysext/core/Classes/DataHandling/DataHandler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);