Skip to content
Snippets Groups Projects
Commit bb6445bf authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

always provide default values, fixes #2203

Closes #2203

Merge request studip/studip!1435
parent 14a9ec3c
No related branches found
No related tags found
No related merge requests found
...@@ -54,16 +54,14 @@ class ProfileModulesController extends AuthenticatedController ...@@ -54,16 +54,14 @@ class ProfileModulesController extends AuthenticatedController
private function getConfig() private function getConfig()
{ {
$config = $GLOBALS['user']->cfg->PLUS_SETTINGS; $default = [
if (!$config || !isset($config['profile_plus'])) { 'view' => 'openall',
return [ 'displaystyle' => 'category',
'view' => 'openall', 'hidden' => [],
'displaystyle' => 'category', ];
'hidden' => [],
];
}
return array_merge(['hidden' => []], $config['profile_plus']); $config = $GLOBALS['user']->cfg->PLUS_SETTINGS;
return array_merge($default, $config['profile_plus'] ?? []);
} }
private function storeConfig(array $config) private function storeConfig(array $config)
......
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