From f4978fcb5a1e9f09dd76520ee6eac03632951971 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 18 Sep 2015 15:56:00 +0200 Subject: [PATCH] NavigationConfigForm: Automatically unshare a child if its parent isn't shared refs #5600 --- application/forms/Navigation/NavigationConfigForm.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/forms/Navigation/NavigationConfigForm.php b/application/forms/Navigation/NavigationConfigForm.php index dc5c3509e..025e59fe3 100644 --- a/application/forms/Navigation/NavigationConfigForm.php +++ b/application/forms/Navigation/NavigationConfigForm.php @@ -322,7 +322,10 @@ class NavigationConfigForm extends ConfigForm $itemConfig = $config->getSection($name); if ($this->hasBeenShared($name)) { - if ((! isset($data['users']) || !$data['users']) && (! isset($data['groups']) || !$data['groups'])) { + if (isset($data['parent']) && $data['parent'] + ? !$this->hasBeenShared($data['parent']) + : ((! isset($data['users']) || !$data['users']) && (! isset($data['groups']) || !$data['groups'])) + ) { // It is shared but shouldn't anymore $config = $this->unshare($name)->config; // unshare() calls setIniConfig() }