From ef9c7957fd8b2b80b306492fbf3f525f13e37243 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Thu, 6 Aug 2026 13:12:06 -0400 Subject: [PATCH] fix: string array keys are converted to int when a number Signed-off-by: Lukas Schaefer --- lib/Service/ApprovalService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Service/ApprovalService.php b/lib/Service/ApprovalService.php index e32b2d31..48db25b9 100644 --- a/lib/Service/ApprovalService.php +++ b/lib/Service/ApprovalService.php @@ -123,6 +123,8 @@ public function getUserRules(string $userId, string $role = 'requesters', ?int $ } // get display names foreach ($userNames as $k => $v) { + // Cast keys to string: PHP coerces numeric string array keys to int + $k = (string)$k; $user = $this->userManager->get($k); $userNames[$k] = $user ? $user->getDisplayName() : $k; } @@ -130,6 +132,8 @@ public function getUserRules(string $userId, string $role = 'requesters', ?int $ $circlesManager = \OC::$server->get(\OCA\Circles\CirclesManager::class); $circlesManager->startSuperSession(); foreach ($circleNames as $k => $v) { + // Cast keys to string: PHP coerces numeric string array keys to int + $k = (string)$k; try { $circle = $circlesManager->getCircle($k); $circleNames[$k] = $circle->getDisplayName(); @@ -853,7 +857,6 @@ public function propFind(int $nodeId): int { return $state['state']; } - /** * Get approval state for multiple files and loads all the tags at once *