mirror of
https://github.com/nextcloud/server.git
synced 2026-05-21 17:45:40 -04:00
Merge pull request #51841 from nextcloud/backport/51760/stable29
[stable29] fix(files_reminders): Lower disabled notifications app error to info
This commit is contained in:
commit
e7d5e80767
3 changed files with 39 additions and 1 deletions
|
|
@ -59,5 +59,7 @@ class Application extends App implements IBootstrap {
|
|||
$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
|
||||
|
||||
$context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScriptsListener::class);
|
||||
|
||||
$context->registerSetupCheck(NeedNotificationsApp::class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ class LoadAdditionalScriptsListener implements IEventListener {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\DAV\SetupChecks;
|
||||
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\SetupCheck\ISetupCheck;
|
||||
use OCP\SetupCheck\SetupResult;
|
||||
|
||||
class NeedNotificationsApp implements ISetupCheck {
|
||||
public function __construct(
|
||||
private IAppManager $appManager,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getName(): string {
|
||||
return $this->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.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue