From b4d21a94165713f735072f92e3b68903011a7274 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Wed, 18 Feb 2026 09:51:48 -0500 Subject: [PATCH] Fix type conflict exception for user config Signed-off-by: Lukas Schaefer --- lib/Controller/ConfigController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php index a26ebf91..35b70752 100644 --- a/lib/Controller/ConfigController.php +++ b/lib/Controller/ConfigController.php @@ -42,6 +42,8 @@ class ConfigController extends Controller { public const CALENDAR_SCOPE = 'https://www.googleapis.com/auth/calendar.readonly'; public const CALENDAR_EVENTS_SCOPE = 'https://www.googleapis.com/auth/calendar.events.readonly'; + public const INT_CONFIGS = ['nb_imported_files', 'drive_imported_size', 'last_drive_import_timestamp', 'drive_import_job_last_start']; + public function __construct( string $appName, IRequest $request, @@ -72,7 +74,13 @@ public function setConfig(array $values): DataResponse { return new DataResponse([], Http::STATUS_BAD_REQUEST); } foreach ($values as $key => $value) { - $this->userConfig->setValueString($this->userId, Application::APP_ID, $key, $value, lazy: true); + if (in_array($key, self::INT_CONFIGS, true)) { + $intValue = (int)$value; + $this->userConfig->setValueInt($this->userId, Application::APP_ID, $key, $intValue, lazy: true); + } else { + $value = (string)$value; + $this->userConfig->setValueString($this->userId, Application::APP_ID, $key, $value, lazy: true); + } } $result = [];