X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FImportBundle%2FImport%2FWallabagImport.php;h=75a28fbf58e0242ec2f0f617266954b5ef83b5ed;hb=9f0957b831622ee577fa7d8f92ec0df6f3a8e274;hp=702da057a0b996b0e8b305f84b86db07c642eb81;hpb=c7ea9b41f32f222fef6a59734ea0b1176bfa1f41;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index 702da057..75a28fbf 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -86,6 +86,18 @@ abstract class WallabagImport extends AbstractImport return $this; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ @@ -108,10 +120,10 @@ abstract class WallabagImport extends AbstractImport $entry->setTitle($data['title']); // update entry with content (in case fetching failed, the given entry will be return) - $entry = $this->fetchContent($entry, $data['url'], $data); + $this->fetchContent($entry, $data['url'], $data); - if (array_key_exists('tags', $data)) { - $this->contentProxy->assignTagsToEntry( + if (\array_key_exists('tags', $data)) { + $this->tagsAssigner->assignTagsToEntry( $entry, $data['tags'], $this->em->getUnitOfWork()->getScheduledEntityInsertions() @@ -122,7 +134,7 @@ abstract class WallabagImport extends AbstractImport $entry->setPreviewPicture($importedEntry['preview_picture']); } - $entry->setArchived($data['is_archived']); + $entry->updateArchived($data['is_archived']); $entry->setStarred($data['is_starred']); if (!empty($data['created_at'])) {