From 9f8f188d928b47503d39348c5990379a572b570a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 18 Dec 2018 13:14:42 +0100 Subject: Validate imported entry to avoid error on import We got some imports with a missing `url` field generating some errors while trying to retrieve an existing entry with that url. Introducing the `validateEntry` allow us to dismiss a message when it doesn't have an url (or other missing stuff in the future) --- src/Wallabag/ImportBundle/Import/FirefoxImport.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Wallabag/ImportBundle/Import/FirefoxImport.php') diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index 73269fe1..8999e3f3 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -30,6 +30,18 @@ class FirefoxImport extends BrowserImport return 'import.firefox.description'; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['uri'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ -- cgit v1.2.3