Skip to content

Commit ccb6fb3

Browse files
Merge pull request #7130 from nextcloud/backport/7127/stable31
[stable31] fix:allow foreign label deletion
2 parents 59e003d + ef3db3e commit ccb6fb3

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

lib/Service/CardService.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,6 @@ public function removeLabel($cardId, $labelId) {
652652
throw new StatusException('Operation not allowed. This card is archived.');
653653
}
654654
$label = $this->labelMapper->find($labelId);
655-
if ($label->getBoardId() !== $this->cardMapper->findBoardId($card->getId())) {
656-
throw new StatusException('Operation not allowed. Label does not exist.');
657-
}
658655
$this->cardMapper->removeLabel($cardId, $labelId);
659656
$this->changeHelper->cardChanged($cardId);
660657
$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
@@ -475,9 +475,6 @@ public function testRemoveLabel() {
475475
$label->setBoardId(1);
476476
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
477477
$this->cardMapper->expects($this->once())->method('removeLabel');
478-
$this->cardMapper->expects($this->once())
479-
->method('findBoardId')
480-
->willReturn(1);
481478
$this->labelMapper->expects($this->once())
482479
->method('find')
483480
->willReturn($label);

0 commit comments

Comments
 (0)