diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index e73e2fdef91b7..ba04068f12123 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -243,7 +243,7 @@ public function setUserValue($userId, $appName, $key, $value, $preCondition = nu } } - $userPreferences->setValueMixed($userId, $appName, $key, $value); + $userPreferences->setValueMixed($userId, $appName, $key, (string)$value); } /** @@ -314,7 +314,14 @@ public function getAllUserValues(?string $userId): array { return []; } - return \OC::$server->get(UserPreferences::class)->getAllValues($userId); + $values = \OC::$server->get(UserPreferences::class)->getAllValues($userId); + $result = []; + foreach($values as $app => $list) { + foreach($list as $key => $value) { + $result[$app][$key] = (string)$value; + } + } + return $result; } /** diff --git a/lib/private/UserPreferences.php b/lib/private/UserPreferences.php index 8fe59b51d5b97..53a647a51de67 100644 --- a/lib/private/UserPreferences.php +++ b/lib/private/UserPreferences.php @@ -144,7 +144,7 @@ public function hasKey(string $userId, string $app, string $key, ?bool $lazy = f $this->loadPreferences($userId, $lazy); if ($lazy === null) { - $appCache = $this->getAllValues($userId, $app); + $appCache = $this->getValues($userId, $app); return isset($appCache[$key]); } @@ -451,7 +451,7 @@ public function getValueMixed( string $userId, string $app, string $key, - string $default = '', + ?string $default = '', ?bool $lazy = false ): string { try {