aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Import/PinboardImport.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2018-12-18 13:14:42 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-01-03 09:42:06 +0100
commit9f8f188d928b47503d39348c5990379a572b570a (patch)
tree0e2b7e488312b7bcb51efee8979ff35544997716 /src/Wallabag/ImportBundle/Import/PinboardImport.php
parent4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff)
downloadwallabag-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/Import/PinboardImport.php')
-rw-r--r--src/Wallabag/ImportBundle/Import/PinboardImport.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php
index 110b0464..995d1f2c 100644
--- a/src/Wallabag/ImportBundle/Import/PinboardImport.php
+++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php
@@ -83,6 +83,18 @@ class PinboardImport extends AbstractImport
83 /** 83 /**
84 * {@inheritdoc} 84 * {@inheritdoc}
85 */ 85 */
86 public function validateEntry(array $importedEntry)
87 {
88 if (empty($importedEntry['href'])) {
89 return false;
90 }
91
92 return true;
93 }
94
95 /**
96 * {@inheritdoc}
97 */
86 public function parseEntry(array $importedEntry) 98 public function parseEntry(array $importedEntry)
87 { 99 {
88 $existingEntry = $this->em 100 $existingEntry = $this->em