Skip to content

Commit

Permalink
Merge pull request #22476 from nextcloud/setting-sections-unique
Browse files Browse the repository at this point in the history
ignore duplicate setting sections
  • Loading branch information
rullzer committed Aug 30, 2020
2 parents 5d4c4b5 + eb4154c commit c43189b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Settings/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function getSections(string $type): array {
return $this->sections[$type];
}

foreach ($this->sectionClasses[$type] as $index => $class) {
foreach (array_unique($this->sectionClasses[$type]) as $index => $class) {
try {
/** @var ISection $section */
$section = \OC::$server->query($class);
Expand All @@ -123,7 +123,7 @@ protected function getSections(string $type): array {
$sectionID = $section->getID();

if (isset($this->sections[$type][$sectionID])) {
$this->log->logException(new \InvalidArgumentException('Section with the same ID already registered'), ['level' => ILogger::INFO]);
$this->log->logException(new \InvalidArgumentException('Section with the same ID already registered: ' . $sectionID . ', class: ' . $class), ['level' => ILogger::INFO]);
continue;
}

Expand Down

0 comments on commit c43189b

Please sign in to comment.