summaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-06 22:33:20 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2023-07-07 16:58:07 +0200
commitfc9fd0d7f2ce12e21568773e9cf8a990eb3c6fd0 (patch)
treeae6f7efad2ccd80b624ed69c3fb0a11a208c99d5 /apps/dav
parentdb1306b9551b20ae6d616aaf0de14ba5f305db64 (diff)
downloadnextcloud-server-fc9fd0d7f2ce12e21568773e9cf8a990eb3c6fd0.tar.gz
nextcloud-server-fc9fd0d7f2ce12e21568773e9cf8a990eb3c6fd0.zip
refactor: adjust to unexposed searchBySystemTag
- in this backport we have to drop the breaking addition in \OCP\Files\Folder - this requires adjustments in check for the existance of the method but also in testing - another change in \OCP\SystemTag\ISystemTagManager can be applied as this interface is not implemented elsewhere Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesReportPlugin.php2
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
index 4b26d837779..1c6727e68ca 100644
--- a/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesReportPlugin.php
@@ -336,7 +336,7 @@ class FilesReportPlugin extends ServerPlugin {
// type check to ensure searchBySystemTag is available, it is not
// exposed in API yet
- if (!empty($systemTagIds)) {
+ if (!empty($systemTagIds) && method_exists($this->userFolder, 'searchBySystemTag')) {
$tags = $this->tagManager->getTagsByIds($systemTagIds, $this->userSession->getUser());
// For we run DB queries per tag and require intersection, we cannot apply limit and offset for DB queries on multi tag search.
diff --git a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
index f1f1cc8b27f..2bbe7bef6de 100644
--- a/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/FilesReportPluginTest.php
@@ -114,6 +114,8 @@ class FilesReportPluginTest extends \Test\TestCase {
$this->userFolder = $this->getMockBuilder(Folder::class)
->disableOriginalConstructor()
+ ->addMethods(['searchBySystemTag'])
+ ->onlyMethods(get_class_methods(Folder::class))
->getMock();
$this->previewManager = $this->getMockBuilder(IPreview::class)