Fixed import of orphaned attachments (IPB4)
authorMarcel Werk <burntime@woltlab.com>
Wed, 13 Mar 2019 14:48:46 +0000 (15:48 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 13 Mar 2019 14:48:46 +0000 (15:48 +0100)
files/lib/system/exporter/IPB4xExporter.class.php

index 55bff1fa4c186dd56ddd98195f892d2186b5965c..e0fee830ee65599c6ad5122ce91a4f533096ac2e 100644 (file)
@@ -969,6 +969,8 @@ class IPB4xExporter extends AbstractExporter {
                $statement = $this->database->prepareStatement($sql, $limit, $offset);
                $statement->execute([$type]);
                while ($row = $statement->fetchArray()) {
+                       if (!$row['attach_id']) continue; // skip orphaned attachments
+                       
                        $fileLocation = $this->fileSystemPath.'uploads/'.$row['attach_location'];
                        
                        ImportHandler::getInstance()->getImporter($objectType)->import($row['attach_id'], [