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
1 merge request!4Draft: Icon creation
......@@ -54,16 +54,14 @@ class ProfileModulesController extends AuthenticatedController
private function getConfig()
{
$config = $GLOBALS['user']->cfg->PLUS_SETTINGS;
if (!$config || !isset($config['profile_plus'])) {
return [
'view' => 'openall',
'displaystyle' => 'category',
'hidden' => [],
];
}
$default = [
'view' => 'openall',
'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)
......
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