[BUGFIX] Prevent error message for correct imports of sys_file_metadata 40/30140/5
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Thu, 15 May 2014 13:02:57 +0000 (15:02 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 21 Jun 2014 09:07:01 +0000 (11:07 +0200)
If sys_file_metadata records are updated on import, a wrong error message
is logged.

Resolves: #58826
Releases: 6.3, 6.2
Change-Id: I023306a69da9c725d52d076d196bf22178ff1f62
Reviewed-on: https://review.typo3.org/30140
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/impexp/Classes/ImportExport.php

index 4f4e7f1..9cd24fa 100644 (file)
@@ -2132,7 +2132,11 @@ class ImportExport {
                                        // Map same ID to same ID....
                                        $this->import_mapId[$table][$old_uid] = $id;
                                } else {
-                                       $this->error('Possible error: ' . $table . ':' . $old_uid . ' had no new id assigned to it. This indicates that the record was not added to database during import. Please check changelog!', 1);
+                                       // if $this->import_mapId contains already the right mapping, skip the error msg. See special handling of sys_file_metadata in addSingle() => nothing to do
+                                       if (!($table === 'sys_file_metadata' && isset($this->import_mapId[$table][$old_uid]) && $this->import_mapId[$table][$old_uid] == $id)) {
+                                               $this->error('Possible error: ' . $table . ':' . $old_uid . ' had no new id assigned to it. This indicates that the record was not added to database during import. Please check changelog!', 1);
+                                       }
+
                                }
                        }
                }