diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2018-12-18 13:14:42 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-01-03 09:42:06 +0100 |
commit | 9f8f188d928b47503d39348c5990379a572b570a (patch) | |
tree | 0e2b7e488312b7bcb51efee8979ff35544997716 /src/Wallabag/ImportBundle/Consumer | |
parent | 4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff) | |
download | wallabag-9f8f188d928b47503d39348c5990379a572b570a.tar.gz wallabag-9f8f188d928b47503d39348c5990379a572b570a.tar.zst wallabag-9f8f188d928b47503d39348c5990379a572b570a.zip |
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)
Diffstat (limited to 'src/Wallabag/ImportBundle/Consumer')
-rw-r--r-- | src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php index b035f5cc..e4bfbdf0 100644 --- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php | |||
@@ -52,6 +52,13 @@ abstract class AbstractConsumer | |||
52 | 52 | ||
53 | $this->import->setUser($user); | 53 | $this->import->setUser($user); |
54 | 54 | ||
55 | if (false === $this->import->validateEntry($storedEntry)) { | ||
56 | $this->logger->warning('Entry is invalid', ['entry' => $storedEntry]); | ||
57 | |||
58 | // return true to skip message | ||
59 | return true; | ||
60 | } | ||
61 | |||
55 | $entry = $this->import->parseEntry($storedEntry); | 62 | $entry = $this->import->parseEntry($storedEntry); |
56 | 63 | ||
57 | if (null === $entry) { | 64 | if (null === $entry) { |