fix: ensure searchBySystemTag() is available

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2023-05-11 13:17:49 +02:00 committed by backportbot-nextcloud[bot]
parent 48c92ade85
commit 6d249b56bd

View file

@ -330,7 +330,9 @@ class FilesReportPlugin extends ServerPlugin {
$nodes = [];
if (!empty($systemTagIds)) {
// type check to ensure searchBySystemTag is available, it is not
// exposed in API yet
if (!empty($systemTagIds) && $this->userFolder instanceof \OC\Files\Node\Folder) {
$tags = $this->tagManager->getTagsByIds($systemTagIds);
$tagName = (current($tags))->getName();
$nodes = $this->userFolder->searchBySystemTag($tagName, $this->userSession->getUser()->getUID(), $limit ?? 0, $offset ?? 0);