aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-08-28 17:06:48 +0200
committerRobin Appelman <robin@icewind.nl>2020-08-28 17:06:48 +0200
commiteb4154cee0ac986d9adc6f7816c0d71f9cd75312 (patch)
tree81304e8fea54290442bf96816466e17613b269bc
parentaad30d3b33ea138a1d436405e25f285f7eda8436 (diff)
downloadnextcloud-server-eb4154cee0ac986d9adc6f7816c0d71f9cd75312.tar.gz
nextcloud-server-eb4154cee0ac986d9adc6f7816c0d71f9cd75312.zip
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>
-rw-r--r--lib/private/Settings/Manager.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php
index ac4f8f9342c..b775e364c39 100644
--- a/lib/private/Settings/Manager.php
+++ b/lib/private/Settings/Manager.php
@@ -106,7 +106,7 @@ class Manager implements IManager {
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);
@@ -123,7 +123,7 @@ class Manager implements IManager {
$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;
}