From 27f6f86d756d53dcfbf150266646c6be22409ec9 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 21 Jun 2023 20:04:35 +0200 Subject: fix: obey offset and limit for results from favs and circles Signed-off-by: Arthur Schiwon --- apps/dav/lib/Connector/Sabre/FilesReportPlugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php index 450fe134772..a828f873086 100644 --- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php @@ -219,6 +219,10 @@ class FilesReportPlugin extends ServerPlugin { // gather all file ids matching filter try { $resultFileIds = $this->processFilterRulesForFileIDs($filterRules); + // no logic in circles and favorites for paging, we always have all results, and slice later on + $resultFileIds = array_slice($resultFileIds, $offset ?? 0, $limit ?? null); + // fetching nodes has paging on DB level – therefore we cannot mix and slice the results, similar + // to user backends. I.e. the final result may return more results than requested. $resultNodes = $this->processFilterRulesForFileNodes($filterRules, $limit ?? null, $offset ?? null); } catch (TagNotFoundException $e) { throw new PreconditionFailed('Cannot filter by non-existing tag', 0, $e); -- cgit v1.2.3