From e6fc010897631a5737e40e6ba050e37a4f9a877a Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 18 Oct 2014 14:29:26 +0200 Subject: [PATCH] Improved message when renaming tag to existing one --- src/Services/TagService.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Services/TagService.php b/src/Services/TagService.php index a07f63d3..8a46c313 100644 --- a/src/Services/TagService.php +++ b/src/Services/TagService.php @@ -173,6 +173,9 @@ class TagService private function updateTagName(Tag $tag, $newName) { + $otherTag = $this->tagDao->findByName($newName); + if ($otherTag and $otherTag->getId() !== $tag->getId()) + throw new \DomainException('Tag with this name already exists.'); $tag->setName($newName); }