From 918c0a6fe9384f263e5ce941535795cac08bc3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=8Carodej?= Date: Sun, 12 Jun 2022 15:15:25 +0200 Subject: [PATCH] trash browsing fix --- src/Domain/Browsing/Controllers/BrowseTrashController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Domain/Browsing/Controllers/BrowseTrashController.php b/src/Domain/Browsing/Controllers/BrowseTrashController.php index 88aa6277..272bbdfc 100644 --- a/src/Domain/Browsing/Controllers/BrowseTrashController.php +++ b/src/Domain/Browsing/Controllers/BrowseTrashController.php @@ -112,7 +112,11 @@ class BrowseTrashController $files = File::onlyTrashed() ->with(['parent']) - ->where($query['file']['where']) + ->where('user_id', $userId) + ->where(function ($query) use ($folders_trashed) { + $query->whereNull('parent_id'); + $query->orWhereNotIn('parent_id', array_values(array_unique(recursiveFind($folders_trashed->toArray(), 'id')))); + }) ->sortable() ->skip($filesSkip) ->take($filesTake)