aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2017-06-02 11:26:37 +0200
committerGitHub <noreply@github.com>2017-06-02 11:26:37 +0200
commita687c8d915276eee0c0494156700f7d0c0606735 (patch)
tree23178dc2407aa1b926b79281c34d8e05b6318d3b /src/Wallabag/ImportBundle/Import/WallabagV1Import.php
parent14b8a7c950147d32d7c9782832b87bf2b18b4fd7 (diff)
parentf5924e954730efdb7b9fadf23c0b73b3f5a0a434 (diff)
downloadwallabag-a687c8d915276eee0c0494156700f7d0c0606735.tar.gz
wallabag-a687c8d915276eee0c0494156700f7d0c0606735.tar.zst
wallabag-a687c8d915276eee0c0494156700f7d0c0606735.zip
Merge pull request #2708 from jcharaoui/import-disablecontentupdate
Import disableContentUpdate
Diffstat (limited to 'src/Wallabag/ImportBundle/Import/WallabagV1Import.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/WallabagV1Import.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
index 59e3ce02..1f0df646 100644
--- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
+++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php
@@ -4,6 +4,17 @@ namespace Wallabag\ImportBundle\Import;
4 4
5class WallabagV1Import extends WallabagImport 5class WallabagV1Import extends WallabagImport
6{ 6{
7 protected $fetchingErrorMessage;
8 protected $fetchingErrorMessageTitle;
9
10 public function __construct($em, $contentProxy, $tagsAssigner, $eventDispatcher, $fetchingErrorMessageTitle, $fetchingErrorMessage)
11 {
12 $this->fetchingErrorMessageTitle = $fetchingErrorMessageTitle;
13 $this->fetchingErrorMessage = $fetchingErrorMessage;
14
15 parent::__construct($em, $contentProxy, $tagsAssigner, $eventDispatcher);
16 }
17
7 /** 18 /**
8 * {@inheritdoc} 19 * {@inheritdoc}
9 */ 20 */
@@ -43,10 +54,11 @@ class WallabagV1Import extends WallabagImport
43 'created_at' => '', 54 'created_at' => '',
44 ]; 55 ];
45 56
46 // force content to be refreshed in case on bad fetch in the v1 installation 57 // In case of a bad fetch in v1, replace title and content with v2 error strings
58 // If fetching fails again, they will get this instead of the v1 strings
47 if (in_array($entry['title'], $this->untitled)) { 59 if (in_array($entry['title'], $this->untitled)) {
48 $data['title'] = ''; 60 $data['title'] = $this->fetchingErrorMessageTitle;
49 $data['html'] = ''; 61 $data['html'] = $this->fetchingErrorMessage;
50 } 62 }
51 63
52 if (array_key_exists('tags', $entry) && $entry['tags'] != '') { 64 if (array_key_exists('tags', $entry) && $entry['tags'] != '') {