From 3b6763722c7bf5c40040b64a4c4636907aaa1ee7 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Thu, 25 Jul 2024 10:31:05 -0700 Subject: [PATCH] fix(files): Fix incorrect keys by reindexing Signed-off-by: Christopher Ng --- lib/private/Files/Node/Folder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 4f7a97081ca40..fe3f24d80cf20 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -218,9 +218,9 @@ public function search($query) { }, array_values($resultsPerCache), array_keys($resultsPerCache))); // don't include this folder in the results - $files = array_filter($files, function (FileInfo $file) { + $files = array_values(array_filter($files, function (FileInfo $file) { return $file->getPath() !== $this->getPath(); - }); + })); // since results were returned per-cache, they are no longer fully sorted $order = $query->getOrder();