Commit edf73e61 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols
Browse files

Fix group edit page for when group categories are enabled but no categories exist (Fixes #628095).


Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 2ad8eaef
......@@ -74,11 +74,13 @@ $elements['grouptype'] = array(
'defaultvalue' => $currenttype,
'help' => true
);
if (get_config('allowgroupcategories')) {
if (get_config('allowgroupcategories')
&& $groupcategories = get_records_menu('group_category','','','displayorder', 'id,title')
) {
$elements['category'] = array(
'type' => 'select',
'title' => get_string('groupcategory', 'group'),
'options' => array('0'=>get_string('nocategoryselected', 'group')) + get_records_menu('group_category','','','displayorder', 'id,title'),
'options' => array('0'=>get_string('nocategoryselected', 'group')) + $groupcategories,
'defaultvalue' => $group_data->category,
'help' => true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment