From f68ebb8282c1468020a2643421966c9104f106d1 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 3 Sep 2013 13:45:00 +1000 Subject: [PATCH] MDL-41517 Do not call fix_course_sortorder unnecessarily Thanks to Thomas Worthington --- course/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/course/lib.php b/course/lib.php index 1796bae10da..7a9e5f5bbc6 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4001,7 +4001,9 @@ function update_course($data, $editoroptions = NULL) { context_moved($context, $newparent); } - fix_course_sortorder(); + if ($movecat || (isset($data->sortorder) && $oldcourse->sortorder != $data->sortorder)) { + fix_course_sortorder(); + } // Test for and remove blocks which aren't appropriate anymore blocks_remove_inappropriate($course);