diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-08 15:41:05 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-08 15:41:05 +0200 |
commit | f652f41dab0b456d24295c8ff47155f28e63f1ed (patch) | |
tree | 034a67e2be86cbb65fa2c4f1037af390930b8ec6 /src/Wallabag/CoreBundle/Controller | |
parent | e969c2a7efe1dd6c1dd13bd8726591f7163397d5 (diff) | |
download | wallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.tar.gz wallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.tar.zst wallabag-f652f41dab0b456d24295c8ff47155f28e63f1ed.zip |
Fix duplicate article when added via the bookmarklet
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 8 |
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 | } |