From 214509f406312247021c866a0f974ef83ee5f6e1 Mon Sep 17 00:00:00 2001 From: Louis Chmn Date: Tue, 3 Feb 2026 12:00:06 +0100 Subject: [PATCH] fix: Migrate `getById` to `getFirstNodeById` Signed-off-by: Louis Chmn --- lib/Files/Util.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Files/Util.php b/lib/Files/Util.php index 0f98479e5d2..2170fb7605f 100644 --- a/lib/Files/Util.php +++ b/lib/Files/Util.php @@ -37,13 +37,12 @@ public function __construct( */ public function getUsersWithAccessFile(string $fileId): array { if (!isset($this->accessLists[$fileId])) { - $nodes = $this->rootFolder->getById((int)$fileId); + $node = $this->rootFolder->getFirstNodeById((int)$fileId); - if (empty($nodes)) { + if ($node === null) { return []; } - $node = array_shift($nodes); $accessList = $this->shareManager->getAccessList($node); $accessList['users'] ??= []; if (!$node->getStorage()->instanceOfStorage(SharedStorage::class)) { @@ -69,13 +68,12 @@ public function canUserAccessFile(string $fileId, string $userId): bool { public function canGuestsAccessFile(string $fileId): bool { if (!isset($this->publicAccessLists[$fileId])) { - $nodes = $this->rootFolder->getById((int)$fileId); + $node = $this->rootFolder->getFirstNodeById((int)$fileId); - if (empty($nodes)) { + if ($node === null) { return false; } - $node = array_shift($nodes); $accessList = $this->shareManager->getAccessList($node, false); $this->publicAccessLists[$fileId] = $accessList['public'] ?? false; }