From eb0cd9685d677a50dbb9075c1ef4b4a9b27febb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Tue, 18 Dec 2018 16:32:30 +0100 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20Jakob=20R=C3=B6hrl=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix for issue586 --- lib/Service/LabelService.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Service/LabelService.php b/lib/Service/LabelService.php index e46ee39ab..0291133df 100644 --- a/lib/Service/LabelService.php +++ b/lib/Service/LabelService.php @@ -90,6 +90,14 @@ class LabelService { throw new BadRequestException('board id must be a number'); } + $boardLabels = $this->labelMapper->findAll($boardId); + foreach($boardLabels as $boardLabel) { + if ($boardLabel->getTitle() === $title) { + throw new BadRequestException('title must be unique'); + break; + } + } + $this->permissionService->checkPermission(null, $boardId, Acl::PERMISSION_MANAGE); if ($this->boardService->isArchived(null, $boardId)) { throw new StatusException('Operation not allowed. This board is archived.');