MDL-35339 call rebuild_course_cache() always (and only) after changing course modules or sections

This commit is contained in:
Marina Glancy
2012-10-15 14:08:14 +08:00
parent 384c3510a9
commit 38b19bbca1
8 changed files with 45 additions and 42 deletions
-9
View File
@@ -188,8 +188,6 @@ if (!empty($add)) {
"view.php?id=$cm->course",
"$cm->modname $cm->instance", $cm->id);
rebuild_course_cache($course->id);
redirect($return);
}
@@ -230,8 +228,6 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
unset($USER->activitycopyname);
unset($USER->activitycopysectionreturn);
rebuild_course_cache($section->course);
redirect(course_get_url($course, $section->section, array('sr' => $sectionreturn)));
} else if (!empty($indent) and confirm_sesskey()) {
@@ -268,8 +264,6 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
set_coursemodule_visible($cm->id, 0);
rebuild_course_cache($cm->course);
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
} else if (!empty($show) and confirm_sesskey()) {
@@ -287,7 +281,6 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
if ($module->visible and ($section->visible or (SITEID == $cm->course))) {
set_coursemodule_visible($cm->id, 1);
rebuild_course_cache($cm->course);
}
redirect(course_get_url($course, $section->section, array('sr' => $sectionreturn)));
@@ -305,8 +298,6 @@ if ((!empty($movetosection) or !empty($moveto)) and confirm_sesskey()) {
set_coursemodule_groupmode($cm->id, $groupmode);
rebuild_course_cache($cm->course);
redirect(course_get_url($course, $cm->sectionnum, array('sr' => $sectionreturn)));
} else if (!empty($copy) and confirm_sesskey()) { // value = course module