From de3b19b2ce227202ab5e4442474441cc4ba10f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 5 Feb 2016 13:50:16 +0100 Subject: Test if some keys are missing in v2 import --- src/Wallabag/ImportBundle/Import/WallabagV2Import.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index 979c671e..c5c0d5a7 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php @@ -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; -- cgit v1.2.3