fix:allow foreign label deletion
Signed-off-by: grnd-alt <github@belakkaf.net>
This commit is contained in:
committed by
backportbot[bot]
parent
59e003df21
commit
ef3db3eec0
@@ -652,9 +652,6 @@ class CardService {
|
|||||||
throw new StatusException('Operation not allowed. This card is archived.');
|
throw new StatusException('Operation not allowed. This card is archived.');
|
||||||
}
|
}
|
||||||
$label = $this->labelMapper->find($labelId);
|
$label = $this->labelMapper->find($labelId);
|
||||||
if ($label->getBoardId() !== $this->cardMapper->findBoardId($card->getId())) {
|
|
||||||
throw new StatusException('Operation not allowed. Label does not exist.');
|
|
||||||
}
|
|
||||||
$this->cardMapper->removeLabel($cardId, $labelId);
|
$this->cardMapper->removeLabel($cardId, $labelId);
|
||||||
$this->changeHelper->cardChanged($cardId);
|
$this->changeHelper->cardChanged($cardId);
|
||||||
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_LABEL_UNASSING, ['label' => $label]);
|
$this->activityManager->triggerEvent(ActivityManager::DECK_OBJECT_CARD, $card, ActivityManager::SUBJECT_LABEL_UNASSING, ['label' => $label]);
|
||||||
|
|||||||
@@ -475,9 +475,6 @@ class CardServiceTest extends TestCase {
|
|||||||
$label->setBoardId(1);
|
$label->setBoardId(1);
|
||||||
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
|
$this->cardMapper->expects($this->once())->method('find')->willReturn($card);
|
||||||
$this->cardMapper->expects($this->once())->method('removeLabel');
|
$this->cardMapper->expects($this->once())->method('removeLabel');
|
||||||
$this->cardMapper->expects($this->once())
|
|
||||||
->method('findBoardId')
|
|
||||||
->willReturn(1);
|
|
||||||
$this->labelMapper->expects($this->once())
|
$this->labelMapper->expects($this->once())
|
||||||
->method('find')
|
->method('find')
|
||||||
->willReturn($label);
|
->willReturn($label);
|
||||||
|
|||||||
Reference in New Issue
Block a user