From 36e6ef52a176ef654eade931a23f60fd91344f2f Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 2 Dec 2016 22:42:36 -0500 Subject: [PATCH] Imported entries which fail to fetch get standard error body --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 2 +- src/Wallabag/ImportBundle/Import/ChromeImport.php | 2 +- src/Wallabag/ImportBundle/Import/FirefoxImport.php | 2 +- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 1 + src/Wallabag/ImportBundle/Import/ReadabilityImport.php | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 77acbd6c..642ba6f9 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -63,7 +63,7 @@ class ContentProxy $html = $content['html']; if (false === $html) { - $html = '

Unable to retrieve readable content.

'; + $html = $this->fetchingErrorMessage; if (isset($content['open_graph']['og_description'])) { $html .= '

But we found a short description:

'; diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index d7620bcb..1a324934 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -37,7 +37,7 @@ class ChromeImport extends BrowserImport { $data = [ 'title' => $entry['name'], - 'html' => '', + 'html' => false, 'url' => $entry['url'], 'is_archived' => $this->markAsRead, 'tags' => '', diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index e010f5a4..d3f99770 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -37,7 +37,7 @@ class FirefoxImport extends BrowserImport { $data = [ 'title' => $entry['title'], - 'html' => '', + 'html' => false, 'url' => $entry['uri'], 'is_archived' => $this->markAsRead, 'tags' => '', diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index cf4c785c..146a8c7c 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -76,6 +76,7 @@ class InstapaperImport extends AbstractImport 'is_starred' => $data[3] === 'Starred', 'content_type' => '', 'language' => '', + 'html' => false, ]; } fclose($handle); diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index b8c0f777..66b00885 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -103,6 +103,7 @@ class ReadabilityImport extends AbstractImport 'is_archived' => $importedEntry['archive'] || $this->markAsRead, 'is_starred' => $importedEntry['favorite'], 'created_at' => $importedEntry['date_added'], + 'html' => false, ]; $entry = new Entry($this->user); -- 2.41.0