From cae60d13ab2cbc705018489f417f0e494bdc4270 Mon Sep 17 00:00:00 2001 From: Eric Merrill Date: Mon, 20 Aug 2012 17:09:40 -0400 Subject: [PATCH] MDL-34985 gradebook Fixing issue where default parent in Full View Add Category could be inconsistent. Turns out the correct default was already computed, but was not being applied to the setting. --- grade/edit/tree/category_form.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/grade/edit/tree/category_form.php b/grade/edit/tree/category_form.php index aec1dea631c..3434dcfd154 100644 --- a/grade/edit/tree/category_form.php +++ b/grade/edit/tree/category_form.php @@ -218,7 +218,7 @@ class edit_category_form extends moodleform { $mform->addElement('header', 'headerparent', get_string('parentcategory', 'grades')); $options = array(); - $default = ''; + $default = -1; $categories = grade_category::fetch_all(array('courseid'=>$COURSE->id)); foreach ($categories as $cat) { @@ -231,6 +231,7 @@ class edit_category_form extends moodleform { if (count($categories) > 1) { $mform->addElement('select', 'parentcategory', get_string('parentcategory', 'grades'), $options); + $mform->setDefault('parentcategory', $default); $mform->addElement('static', 'currentparentaggregation', get_string('currentparentaggregation', 'grades')); }