Skip to content
Snippets Groups Projects
Unverified Commit eb4154ce authored by Robin Appelman's avatar Robin Appelman
Browse files

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: default avatarRobin Appelman <robin@icewind.nl>
parent aad30d3b
No related branches found
No related tags found
No related merge requests found
...@@ -106,7 +106,7 @@ class Manager implements IManager { ...@@ -106,7 +106,7 @@ class Manager implements IManager {
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);
...@@ -123,7 +123,7 @@ class Manager implements IManager { ...@@ -123,7 +123,7 @@ class Manager implements IManager {
$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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment