Преглед изворни кода

ignore duplicate setting sections

this prevents some 'Section with the same ID already registered' errors in the log

also includes an improvement of the error message to make other cases easier to find

Signed-off-by: Robin Appelman <robin@icewind.nl>
tags/v20.0.0beta3
Robin Appelman пре 3 година
родитељ
комит
eb4154cee0
No account linked to committer's email address
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2
    2
      lib/private/Settings/Manager.php

+ 2
- 2
lib/private/Settings/Manager.php Прегледај датотеку

return $this->sections[$type]; return $this->sections[$type];
} }


foreach ($this->sectionClasses[$type] as $index => $class) {
foreach (array_unique($this->sectionClasses[$type]) as $index => $class) {
try { try {
/** @var ISection $section */ /** @var ISection $section */
$section = \OC::$server->query($class); $section = \OC::$server->query($class);
$sectionID = $section->getID(); $sectionID = $section->getID();


if (isset($this->sections[$type][$sectionID])) { 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; continue;
} }



Loading…
Откажи
Сачувај