}
$newcategory->context = get_context_instance(CONTEXT_COURSECAT, $newcategory->id);
mark_context_dirty($newcategory->context->path);
+ fix_course_sortorder(); // Required to build course_categories.depth and .path.
}
redirect('category.php?id='.$newcategory->id.'&categoryedit=on');
}
}
$tempcat->context = get_context_instance(CONTEXT_COURSECAT, $tempcat->id);
mark_context_dirty('/'.SYSCONTEXTID);
+ fix_course_sortorder(); // Required to build course_categories.depth and .path.
}
/// Move a category to a new parent if required
// make sure category context exists
get_context_instance(CONTEXT_COURSECAT, $catid);
mark_context_dirty('/'.SYSCONTEXTID);
+ fix_course_sortorder(); // Required to build course_categories.depth and .path.
$category = $DB->get_record('course_categories', array('id'=>$catid));
}
}