1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

Replace Wallabag v1 error strings with v2 strings

This commit is contained in:
Jerome Charaoui 2016-12-16 09:46:21 -05:00 committed by Jeremy Benoist
parent d0e9b3d640
commit 704803e182
No known key found for this signature in database
GPG key ID: FB413A58C7715C86
3 changed files with 27 additions and 4 deletions

View file

@ -4,6 +4,17 @@ namespace Wallabag\ImportBundle\Import;
class WallabagV1Import extends WallabagImport
{
protected $fetchingErrorMessage;
protected $fetchingErrorMessageTitle;
public function __construct($em, $contentProxy, $eventDispatcher, $fetchingErrorMessageTitle, $fetchingErrorMessage)
{
$this->fetchingErrorMessageTitle = $fetchingErrorMessageTitle;
$this->fetchingErrorMessage = $fetchingErrorMessage;
parent::__construct($em, $contentProxy, $eventDispatcher);
}
/**
* {@inheritdoc}
*/
@ -43,10 +54,11 @@ class WallabagV1Import extends WallabagImport
'created_at' => '',
];
// force content to be refreshed in case on bad fetch in the v1 installation
// In case of a bad fetch in v1, replace title and content with v2 error strings
// If fetching fails again, they will get this instead of the v1 strings
if (in_array($entry['title'], $this->untitled)) {
$data['title'] = '';
$data['html'] = '';
$data['title'] = $this->fetchingErrorMessageTitle;
$data['html'] = $this->fetchingErrorMessage;
}
if (array_key_exists('tags', $entry) && $entry['tags'] != '') {

View file

@ -35,6 +35,8 @@ services:
- "@wallabag_core.content_proxy"
- "@wallabag_core.tags_assigner"
- "@event_dispatcher"
- "%wallabag_core.fetching_error_message_title%"
- "%wallabag_core.fetching_error_message%"
calls:
- [ setLogger, [ "@logger" ]]
tags: