From 8f11d2a39b7eef8120fec918c4e2e4f02bcbd633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 20 May 2019 18:07:24 +0200 Subject: [PATCH] Only show sharing section if it has content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/federatedfilesharing/lib/Settings/Personal.php | 3 +++ lib/private/Settings/Manager.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/apps/federatedfilesharing/lib/Settings/Personal.php b/apps/federatedfilesharing/lib/Settings/Personal.php index 96c762c9e4..d50fa7202f 100644 --- a/apps/federatedfilesharing/lib/Settings/Personal.php +++ b/apps/federatedfilesharing/lib/Settings/Personal.php @@ -80,6 +80,9 @@ class Personal implements ISettings { * @since 9.1 */ public function getSection() { + if (!$this->federatedShareProvider->isOutgoingServer2serverShareEnabled()) { + return null; + } return 'sharing'; } diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index 42ec16e223..7281d7bf72 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -171,6 +171,10 @@ class Manager implements IManager { continue; } + if ($setting->getSection() === null) { + continue; + } + if (!isset($this->settings[$settingsType][$setting->getSection()])) { $this->settings[$settingsType][$setting->getSection()] = []; }