NavigationConfigForm: Automatically unshare a child if its parent isn't shared

refs #5600
This commit is contained in:
Johannes Meyer 2015-09-18 15:56:00 +02:00
parent f1c6b34d7a
commit f4978fcb5a
1 changed files with 4 additions and 1 deletions

View File

@ -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()
}