aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-04-08 15:41:05 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2016-04-08 15:41:05 +0200
commitf652f41dab0b456d24295c8ff47155f28e63f1ed (patch)
tree034a67e2be86cbb65fa2c4f1037af390930b8ec6
parente969c2a7efe1dd6c1dd13bd8726591f7163397d5 (diff)
downloadwallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.tar.gz
wallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.tar.zst
wallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.zip
Fix duplicate article when added via the bookmarklet
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index fa633031..1d0df889 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -86,7 +86,13 @@ class EntryController extends Controller
86 { 86 {
87 $entry = new Entry($this->getUser()); 87 $entry = new Entry($this->getUser());
88 $entry->setUrl($request->get('url')); 88 $entry->setUrl($request->get('url'));
89 $this->updateEntry($entry); 89
90 // check for existing entry, if it exists, redirect to it with a message
91 $existingEntry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
92
93 if (false === $existingEntry) {
94 $this->updateEntry($entry);
95 }
90 96
91 return $this->redirect($this->generateUrl('homepage')); 97 return $this->redirect($this->generateUrl('homepage'));
92 } 98 }