Skip to content

Commit

Permalink
[BUGFIX] Fix PHP 8 warnings in DataHandler
Browse files Browse the repository at this point in the history
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 <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
thomashohn authored and lolli42 committed Aug 7, 2023
1 parent a99ce85 commit ff91d3d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -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);
Expand Down

0 comments on commit ff91d3d

Please sign in to comment.