diff --git a/admin/tool/multilangupgrade/index.php b/admin/tool/multilangupgrade/index.php index 6b4ce5c4600..0cc6b4144f3 100644 --- a/admin/tool/multilangupgrade/index.php +++ b/admin/tool/multilangupgrade/index.php @@ -121,7 +121,7 @@ echo $OUTPUT->box_end(); /// Rebuild course cache which might be incorrect now echo $OUTPUT->notification('Rebuilding course cache...', 'notifysuccess'); -rebuild_course_cache(); +rebuild_course_cache(0, true); echo $OUTPUT->notification('...finished', 'notifysuccess'); echo $OUTPUT->continue_button(new moodle_url('/admin/')); diff --git a/mod/lti/locallib.php b/mod/lti/locallib.php index e8709c6ebe6..caeb3b61e44 100644 --- a/mod/lti/locallib.php +++ b/mod/lti/locallib.php @@ -1522,7 +1522,15 @@ function lti_update_type($type, $config) { } require_once($CFG->libdir.'/modinfolib.php'); if ($clearcache) { - rebuild_course_cache(); + $sql = "SELECT DISTINCT course + FROM {lti} + WHERE typeid = ?"; + + $courses = $DB->get_fieldset_sql($sql, array($type->id)); + + foreach ($courses as $courseid) { + rebuild_course_cache($courseid, true); + } } } } diff --git a/user/profile/definelib.php b/user/profile/definelib.php index b60d5add2d2..fecf3159adb 100644 --- a/user/profile/definelib.php +++ b/user/profile/definelib.php @@ -322,7 +322,7 @@ function profile_delete_field($id) { // but show the field as missing until manually corrected to something else. // Need to rebuild course cache to update the info. - rebuild_course_cache(); + rebuild_course_cache(0, true); // Try to remove the record from the database. $DB->delete_records('user_info_field', array('id' => $id));