forked from wallabag/wallabag
Fix duplicate article when added via the bookmarklet
This commit is contained in:
@ -86,7 +86,13 @@ class EntryController extends Controller
|
|||||||
{
|
{
|
||||||
$entry = new Entry($this->getUser());
|
$entry = new Entry($this->getUser());
|
||||||
$entry->setUrl($request->get('url'));
|
$entry->setUrl($request->get('url'));
|
||||||
$this->updateEntry($entry);
|
|
||||||
|
// check for existing entry, if it exists, redirect to it with a message
|
||||||
|
$existingEntry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
|
||||||
|
|
||||||
|
if (false === $existingEntry) {
|
||||||
|
$this->updateEntry($entry);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->redirect($this->generateUrl('homepage'));
|
return $this->redirect($this->generateUrl('homepage'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user