mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #29019 from nextcloud/bugfix/noid/improve-log-and-allow-duplicate-notifications-section
Improve log and allow duplicate notifications section
This commit is contained in:
commit
b28f4989ff
1 changed files with 12 additions and 3 deletions
|
|
@ -131,8 +131,9 @@ class Manager implements IManager {
|
|||
|
||||
$sectionID = $section->getID();
|
||||
|
||||
if ($sectionID !== 'connected-accounts' && isset($this->sections[$type][$sectionID])) {
|
||||
$this->log->info('', ['exception' => new \InvalidArgumentException('Section with the same ID already registered: ' . $sectionID . ', class: ' . $class)]);
|
||||
if (!$this->isKnownDuplicateSectionId($sectionID) && isset($this->sections[$type][$sectionID])) {
|
||||
$e = new \InvalidArgumentException('Section with the same ID already registered: ' . $sectionID . ', class: ' . $class);
|
||||
$this->log->info($e->getMessage(), ['exception' => $e]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -144,6 +145,13 @@ class Manager implements IManager {
|
|||
return $this->sections[$type];
|
||||
}
|
||||
|
||||
protected function isKnownDuplicateSectionId(string $sectionID): bool {
|
||||
return in_array($sectionID, [
|
||||
'connected-accounts',
|
||||
'notifications',
|
||||
], true);
|
||||
}
|
||||
|
||||
/** @var array */
|
||||
protected $settingClasses = [];
|
||||
|
||||
|
|
@ -190,7 +198,8 @@ class Manager implements IManager {
|
|||
}
|
||||
|
||||
if (!$setting instanceof ISettings) {
|
||||
$this->log->info('', ['exception' => new \InvalidArgumentException('Invalid settings setting registered (' . $class . ')')]);
|
||||
$e = new \InvalidArgumentException('Invalid settings setting registered (' . $class . ')');
|
||||
$this->log->info($e->getMessage(), ['exception' => $e]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue