diff --git a/lib/Hooks/TrashbinHook.php b/lib/Hooks/TrashbinHook.php index 59a3785..a75739d 100644 --- a/lib/Hooks/TrashbinHook.php +++ b/lib/Hooks/TrashbinHook.php @@ -1,5 +1,10 @@ trashbinMapper = $trashbinMapper; } + /** + * The method called when a node is permanently deleted. + * + * @param array $params ['path' => {path}] + * @return void + */ public function permanentDelete(array $params): void { // get the filecache items and find out if we are dealing with an f_account item @@ -63,13 +74,12 @@ public function permanentDelete(array $params): void $fAccountView = new View("/$fAccountUID"); $fAccountView->unlink($fAccountFileCacheItem[FileCacheMapper::TABLE_COLUMN_PATH]); - + if (isset($ownerOrUserFileCacheItem)) { $ownerOrUserView = new View("/$ownerOrUserUserUID"); $ownerOrUserView->unlink($ownerOrUserFileCacheItem[FileCacheMapper::TABLE_COLUMN_PATH]); } - // retrieve the trashbin items so we can delete them from the table [$fileOrFoldername, $timestamp] = $this->trashbinService->getNameAndTimestamp($name); $trashbinItems = $this->trashbinMapper->getItems($fileOrFoldername, $timestamp);