Skip to content

Commit 298e46f

Browse files
Merge pull request #7129 from nextcloud/backport/7127/stable30
[stable30] fix:allow foreign label deletion
2 parents 1467164 + ede59e8 commit 298e46f

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

lib/Service/CardService.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,6 @@ public function removeLabel($cardId, $labelId) {
645645
throw new StatusException('Operation not allowed. This card is archived.');
646646
}
647647
$label = $this->labelMapper->find($labelId);
648-
if ($label->getBoardId() !== $this->cardMapper->findBoardId($card->getId())) {
649-
throw new StatusException('Operation not allowed. Label does not exist.');
650-
}
651648
$this->cardMapper->removeLabel($cardId, $labelId);
652649
$this->changeHelper->cardChanged($cardId);
653650
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_LABEL_UNASSING, ['label' => $label]);

tests/unit/Service/CardServiceTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,6 @@ public function testRemoveLabel() {
379379
$label->setBoardId(1);
380380
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
381381
$this->cardMapper->expects($this->once())->method('removeLabel');
382-
$this->cardMapper->expects($this->once())
383-
->method('findBoardId')
384-
->willReturn(1);
385382
$this->labelMapper->expects($this->once())
386383
->method('find')
387384
->willReturn($label);

0 commit comments

Comments
 (0)