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.');