diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index dcca575b3..eb0992b51 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -63,7 +63,7 @@ public function personal(int $batchSetting, string $soundNotification, string $s * @AuthorizedAdminSetting(settings=OCA\Notifications\Settings\Admin) */ public function admin(int $batchSetting, string $soundNotification, string $soundTalk): DataResponse { - $this->config->setAppValue(Application::APP_ID, 'setting_batchtime', $batchSetting); + $this->config->setAppValue(Application::APP_ID, 'setting_batchtime', (string) $batchSetting); $this->config->setAppValue(Application::APP_ID, 'sound_notification', $soundNotification !== 'no' ? 'yes' : 'no'); $this->config->setAppValue(Application::APP_ID, 'sound_talk', $soundTalk !== 'no' ? 'yes' : 'no'); diff --git a/lib/Listener/PostLoginListener.php b/lib/Listener/PostLoginListener.php index f9fbf7b6a..307b1a35d 100644 --- a/lib/Listener/PostLoginListener.php +++ b/lib/Listener/PostLoginListener.php @@ -60,7 +60,7 @@ public function handle(Event $event): void { } catch (DoesNotExistException $e) { $defaultSoundNotification = $this->config->getAppValue(Application::APP_ID, 'sound_notification') === 'yes' ? 'yes' : 'no'; $defaultSoundTalk = $this->config->getAppValue(Application::APP_ID, 'sound_talk') === 'yes' ? 'yes' : 'no'; - $defaultBatchtime = $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); + $defaultBatchtime = (int) $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); if ($defaultBatchtime !== Settings::EMAIL_SEND_WEEKLY && $defaultBatchtime !== Settings::EMAIL_SEND_DAILY diff --git a/lib/Listener/UserCreatedListener.php b/lib/Listener/UserCreatedListener.php index f8eae5344..17c76160d 100644 --- a/lib/Listener/UserCreatedListener.php +++ b/lib/Listener/UserCreatedListener.php @@ -55,7 +55,7 @@ public function handle(Event $event): void { $defaultSoundNotification = $this->config->getAppValue(Application::APP_ID, 'sound_notification') === 'yes' ? 'yes' : 'no'; $defaultSoundTalk = $this->config->getAppValue(Application::APP_ID, 'sound_talk') === 'yes' ? 'yes' : 'no'; - $defaultBatchtime = $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); + $defaultBatchtime = (int) $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); if ($defaultBatchtime !== Settings::EMAIL_SEND_WEEKLY && $defaultBatchtime !== Settings::EMAIL_SEND_DAILY diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 56761218a..749e0a81e 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -61,7 +61,7 @@ public function getForm(): TemplateResponse { $defaultSoundNotification = $this->config->getAppValue(Application::APP_ID, 'sound_notification') === 'yes' ? 'yes' : 'no'; $defaultSoundTalk = $this->config->getAppValue(Application::APP_ID, 'sound_talk') === 'yes' ? 'yes' : 'no'; - $defaultBatchtime = $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); + $defaultBatchtime = (int) $this->config->getAppValue(Application::APP_ID, 'setting_batchtime'); if ($defaultBatchtime != Settings::EMAIL_SEND_WEEKLY && $defaultBatchtime != Settings::EMAIL_SEND_DAILY diff --git a/tests/Unit/AppInfo/RoutesTest.php b/tests/Unit/AppInfo/RoutesTest.php index 96d2ded74..418694388 100644 --- a/tests/Unit/AppInfo/RoutesTest.php +++ b/tests/Unit/AppInfo/RoutesTest.php @@ -37,6 +37,6 @@ public function testRoutes() { $this->assertCount(1, $routes); $this->assertArrayHasKey('ocs', $routes); $this->assertIsArray($routes['ocs']); - $this->assertCount(8, $routes['ocs']); + $this->assertCount(9, $routes['ocs']); } }