aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 608ed2f0..2813c944 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -462,6 +462,14 @@ class Entry
462 return; 462 return;
463 } 463 }
464 464
465 // check if tag already exist but has not yet be persisted
466 // it seems that the previous condition with `contains()` doesn't check that case
467 foreach ($this->tags as $existingTag) {
468 if ($existingTag->getUser() !== $tag->getUser() || $existingTag->getLabel() === $tag->getLabel()) {
469 return;
470 }
471 }
472
465 $this->tags[] = $tag; 473 $this->tags[] = $tag;
466 $tag->addEntry($this); 474 $tag->addEntry($this);
467 } 475 }