fix(file-search): use default limit to search query if not provided on request body

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
This commit is contained in:
Cristian Scheid 2026-04-01 13:22:30 -03:00 committed by backportbot[bot]
parent 48339edf50
commit 607c78aa06
2 changed files with 7 additions and 6 deletions

View file

@ -343,6 +343,7 @@ class FileSearchBackend implements ISearchBackend {
}, $query->orderBy);
$limit = $query->limit;
$maxResults = $limit->maxResults !== 0 ? (int)$limit->maxResults : 100;
$offset = $limit->firstResult;
$limitHome = false;
@ -370,7 +371,7 @@ class FileSearchBackend implements ISearchBackend {
return new SearchQuery(
$operators,
(int)$limit->maxResults,
$maxResults,
$offset,
$orders,
$this->user,

View file

@ -97,7 +97,7 @@ class FileSearchBackendTest extends TestCase {
'name',
'foo'
),
0,
100,
0,
[],
$this->user
@ -126,7 +126,7 @@ class FileSearchBackendTest extends TestCase {
'mimetype',
'foo'
),
0,
100,
0,
[],
$this->user
@ -155,7 +155,7 @@ class FileSearchBackendTest extends TestCase {
'size',
10
),
0,
100,
0,
[],
$this->user
@ -184,7 +184,7 @@ class FileSearchBackendTest extends TestCase {
'mtime',
10
),
0,
100,
0,
[],
$this->user
@ -213,7 +213,7 @@ class FileSearchBackendTest extends TestCase {
'mimetype',
FileInfo::MIMETYPE_FOLDER
),
0,
100,
0,
[],
$this->user