[BUGFIX] Missing check before foreach loop 30/45330/2
authorOliver Hader <oliver@typo3.org>
Thu, 17 Dec 2015 10:41:06 +0000 (11:41 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 17 Dec 2015 11:35:27 +0000 (12:35 +0100)
PHP Warning: Invalid argument supplied for foreach()
in typo3/sysext/core/Classes/DataHandling/DataHandler.php line 5285

Resolves: #72289
Releases: master, 6.2
Change-Id: If83dee7261ce3dd6d1fbf3bb81d8f2e53741c4c7
Reviewed-on: https://review.typo3.org/45330
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 14dc618..5ff6db5 100644 (file)
@@ -4786,6 +4786,9 @@ class DataHandler {
        public function deleteRecord_procFields($table, $uid, $undeleteRecord = FALSE) {
                $conf = $GLOBALS['TCA'][$table]['columns'];
                $row = BackendUtility::getRecord($table, $uid, '*', '', FALSE);
+               if (empty($row)) {
+                       return;
+               }
                foreach ($row as $field => $value) {
                        $this->deleteRecord_procBasedOnFieldType($table, $uid, $field, $value, $conf[$field]['config'], $undeleteRecord);
                }