[BUGFIX] Don't rely on not found database records impexp 93/29993/3
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Fri, 9 May 2014 16:51:45 +0000 (18:51 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 13 May 2014 17:24:46 +0000 (19:24 +0200)
The function exec_SELECTgetSingleRow could also return
FALSE in addition to NULL, so add a additional check.

Resolves: #58688
Resolves: #57348
Releases: 6.2
Change-Id: Ic04071f67f02cce12b11c34d46c084bc28ccc83a
Reviewed-on: https://review.typo3.org/29993
Reviewed-by: Marc Bastian Heinrichs
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/impexp/Classes/ImportExport.php

index bce1660..815b269 100644 (file)
@@ -1924,7 +1924,9 @@ class ImportExport {
                                                'sys_file_metadata',
                                                'file = ' . $this->import_mapId['sys_file'][$record['file']] . ' AND sys_language_uid = 0 AND pid = 0'
                                        );
-                                       if ($recordInDatabase !== NULL) {
+                                       // if no record could be found, $this->import_mapId['sys_file'][$record['file']] is pointing
+                                       // to a file, that was already there, thus a new metadata record should be created
+                                       if (is_array($recordInDatabase)) {
                                                $this->import_mapId['sys_file_metadata'][$record['uid']] = $recordInDatabase['uid'];
                                                $ID = $recordInDatabase['uid'];
                                        } else {