aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Service
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Service')
-rw-r--r--apps/files/lib/Service/UserConfig.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/lib/Service/UserConfig.php b/apps/files/lib/Service/UserConfig.php
index e405b02c07a..c39719ae8ed 100644
--- a/apps/files/lib/Service/UserConfig.php
+++ b/apps/files/lib/Service/UserConfig.php
@@ -41,6 +41,12 @@ class UserConfig {
'default' => false,
'allowed' => [true, false],
],
+ [
+ // Whether to sort favorites first in the list or not
+ 'key' => 'sort_favorites_first',
+ 'default' => true,
+ 'allowed' => [true, false],
+ ],
];
protected IConfig $config;
@@ -133,7 +139,7 @@ class UserConfig {
$userConfigs = array_map(function(string $key) use ($userId) {
$value = $this->config->getUserValue($userId, Application::APP_ID, $key, $this->getDefaultConfigValue($key));
// If the default is expected to be a boolean, we need to cast the value
- if (is_bool($this->getDefaultConfigValue($key))) {
+ if (is_bool($this->getDefaultConfigValue($key)) && is_string($value)) {
return $value === '1';
}
return $value;