]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Test if some keys are missing in v2 import
authorNicolas Lœuillet <nicolas.loeuillet@smile.fr>
Fri, 5 Feb 2016 12:50:16 +0000 (13:50 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@smile.fr>
Fri, 5 Feb 2016 12:50:16 +0000 (13:50 +0100)
src/Wallabag/ImportBundle/Import/WallabagV2Import.php

index 979c671e991512c460f4e6603fba889a8457e3d7..c5c0d5a798fea627735818a85d22c701e04bc1f5 100644 (file)
@@ -56,9 +56,15 @@ class WallabagV2Import extends WallabagV1Import implements ImportInterface
             $entry->setContent($importedEntry['content']);
             $entry->setReadingTime($importedEntry['reading_time']);
             $entry->setDomainName($importedEntry['domain_name']);
-            $entry->setMimetype($importedEntry['mimetype']);
-            $entry->setLanguage($importedEntry['language']);
-            $entry->setPreviewPicture($importedEntry['preview_picture']);
+            if (isset($importedEntry['mimetype'])) {
+                $entry->setMimetype($importedEntry['mimetype']);
+            }
+            if (isset($importedEntry['language'])) {
+                $entry->setLanguage($importedEntry['language']);
+            }
+            if (isset($importedEntry['preview_picture'])) {
+                $entry->setPreviewPicture($importedEntry['preview_picture']);
+            }
 
             $this->em->persist($entry);
             ++$this->importedEntries;