]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Import/AbstractImport.php
Minor typo fix
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Import / AbstractImport.php
index 2af0e69b473a0e117f02c2efd66de5512004331c..764b390a830428fbdc60ddf6a793d8d632fb75b0 100644 (file)
@@ -79,20 +79,20 @@ abstract class AbstractImport implements ImportInterface
 
     /**
      * Fetch content from the ContentProxy (using graby).
-     * If it fails return false instead of the updated entry.
+     * If it fails return the given entry to be saved in all case (to avoid user to loose the content).
      *
      * @param Entry  $entry   Entry to update
      * @param string $url     Url to grab content for
      * @param array  $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url
      *
-     * @return Entry|false
+     * @return Entry
      */
     protected function fetchContent(Entry $entry, $url, array $content = [])
     {
         try {
             return $this->contentProxy->updateEntry($entry, $url, $content);
         } catch (\Exception $e) {
-            return false;
+            return $entry;
         }
     }
 
@@ -106,6 +106,10 @@ abstract class AbstractImport implements ImportInterface
         $i = 1;
 
         foreach ($entries as $importedEntry) {
+            if ($this->markAsRead) {
+                $importedEntry = $this->setEntryAsRead($importedEntry);
+            }
+
             $entry = $this->parseEntry($importedEntry);
 
             if (null === $entry) {