MDL-41517 Do not call fix_course_sortorder unnecessarily

Thanks to Thomas Worthington
This commit is contained in:
Marina Glancy
2013-09-03 13:45:00 +10:00
parent ee788142f2
commit 24f824b924
+4 -1
View File
@@ -2408,7 +2408,10 @@ function update_course($data, $editoroptions = NULL) {
$context->update_moved($newparent);
}
fix_course_sortorder();
if ($movecat || (isset($data->sortorder) && $oldcourse->sortorder != $data->sortorder)) {
fix_course_sortorder();
}
// purge appropriate caches in case fix_course_sortorder() did not change anything
cache_helper::purge_by_event('changesincourse');
if ($changesincoursecat) {