]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/WallabagV2Import.php
Merge pull request #1656 from wallabag/v2-fix-new-user-password-prompts
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagV2Import.php
index 979c671e991512c460f4e6603fba889a8457e3d7..7125eabc1681bff429ce543994feac6e325e2572 100644 (file)
@@ -27,7 +27,7 @@ class WallabagV2Import extends WallabagV1Import implements ImportInterface
      */
     public function getDescription()
     {
-        return 'This importer will import all your wallabag v2 articles. On the export sidebar, click on "JSON". You will have a "Unread articles.json" file.';
+        return 'This importer will import all your wallabag v2 articles. Go to All articles, then, on the export sidebar, click on "JSON". You will have a "All articles.json" 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;