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)
This commit is contained in:
Jeremy Benoist
2018-12-18 13:14:42 +01:00
parent 4d0c632c70
commit 9f8f188d92
10 changed files with 108 additions and 4 deletions

View File

@ -168,6 +168,18 @@ class PocketImport extends AbstractImport
$this->client = $client;
}
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry)
{
if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) {
return false;
}
return true;
}
/**
* {@inheritdoc}
*