diff --git a/apps/files_reminders/lib/AppInfo/Application.php b/apps/files_reminders/lib/AppInfo/Application.php index 56b0c97a7a268..6beb7da640c8e 100644 --- a/apps/files_reminders/lib/AppInfo/Application.php +++ b/apps/files_reminders/lib/AppInfo/Application.php @@ -55,5 +55,7 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); $context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScriptsListener::class); + + $context->registerSetupCheck(NeedNotificationsApp::class); } } diff --git a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php index bc5a44d144192..8d397ff10d77f 100644 --- a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php +++ b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php @@ -47,7 +47,6 @@ public function handle(Event $event): void { } if (!$this->appManager->isEnabledForUser('notifications')) { - $this->logger->error('Failed to register the `files_reminders` app. This could happen due to the `notifications` app being disabled.', ['app' => 'files_reminders']); return; } diff --git a/apps/files_reminders/lib/SetupChecks/NeedNotificationsApp.php b/apps/files_reminders/lib/SetupChecks/NeedNotificationsApp.php new file mode 100644 index 0000000000000..2fc80094152be --- /dev/null +++ b/apps/files_reminders/lib/SetupChecks/NeedNotificationsApp.php @@ -0,0 +1,37 @@ +l10n->t('Files reminder'); + } + + public function getCategory(): string { + return 'system'; + } + + public function run(): SetupResult { + if ($this->appManager->isInstalled('notifications')) { + return SetupResult::success($this->l10n->t('This files_reminder can work properly.')); + } else { + return SetupResult::warning($this->l10n->t('The files_reminder app needs the notification app to work properly. You should either enable notifications or disable files_reminder.')); + } + } +}