]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/WallabagImport.php
Avoid losing entry when fetching fail
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / WallabagImport.php
index 969a6a04981a8eaf4a4339059f43e3c52a33b5a5..043bb0a2363e3e6982a7906a0a80791acba0da13 100644 (file)
@@ -101,18 +101,12 @@ abstract class WallabagImport extends AbstractImport
 
         $data = $this->prepareEntry($importedEntry);
 
-        $entry = $this->fetchContent(
-            new Entry($this->user),
-            $importedEntry['url'],
-            $data
-        );
-
-        // jump to next entry in case of problem while getting content
-        if (false === $entry) {
-            ++$this->skippedEntries;
+        $entry = new Entry($this->user);
+        $entry->setUrl($data['url']);
+        $entry->setTitle($data['title']);
 
-            return;
-        }
+        // update entry with content (in case fetching failed, the given entry will be return)
+        $entry = $this->fetchContent($entry, $data['url'], $data);
 
         if (array_key_exists('tags', $data)) {
             $this->contentProxy->assignTagsToEntry(