Skip to content

Commit

Permalink
dont remove trash item from cache if the delete failed
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed Sep 25, 2019
1 parent 7e68502 commit ac89a22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public function removeItem(ITrashItem $item) {
if ($node === null) {
throw new NotFoundException();
}
$node->getStorage()->unlink($node->getInternalPath());
if ($node->getStorage()->unlink($node->getInternalPath()) === false) {
throw new \Exception('Failed to remove item from trashbin');
}
$node->getStorage()->getCache()->remove($node->getInternalPath());
if ($item->isRootItem()) {
$this->trashManager->removeItem($folderId, $item->getName(), $item->getDeletedTime());
Expand Down

0 comments on commit ac89a22

Please sign in to comment.