MDL-12350 do not set parent cat when updating; merged from MOODLE_19_STABLE

This commit is contained in:
skodak 2007-11-26 17:45:56 +00:00
parent 8263f8024d
commit c267a2886a
2 changed files with 5 additions and 9 deletions

View File

@ -125,15 +125,15 @@ if ($data = $mform->get_data(false)) {
$grade_item->itemtype = 'manual'; // all new items to be manual only
$grade_item->insert();
// set parent if needed
if (isset($data->parentcategory)) {
$grade_item->set_parent($data->parentcategory, 'gradebook');
}
} else {
$grade_item->update();
}
// set parent if needed
if (isset($data->parentcategory)) {
$grade_item->set_parent($data->parentcategory, 'gradebook');
}
// update hiding flag
if ($hiddenuntil) {
$grade_item->set_hidden($hiddenuntil, false);

View File

@ -186,10 +186,6 @@ if ($data = $mform->get_data(false)) {
} else {
$grade_item->update();
// set parent if needed
if (isset($data->parentcategory)) {
$grade_item->set_parent($data->parentcategory, 'gradebook');
}
}
// update hiding flag