diff --git a/course/lib.php b/course/lib.php index c412e0b1e7f..6fcfe4a461f 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4561,9 +4561,6 @@ function include_course_ajax($course, $modules = array(), $config = null) { $PAGE->requires->string_for_js('pluginname', $module); } - // Prevent caching of this page to stop confusion when changing page after making AJAX changes - $PAGE->set_cacheable(false); - return true; } diff --git a/course/view.php b/course/view.php index 7a4d7aa37ab..e6bc3039235 100644 --- a/course/view.php +++ b/course/view.php @@ -38,6 +38,9 @@ $PAGE->set_url('/course/view.php', $urlparams); // Defined here to avoid notices on errors etc + // Prevent caching of this page to stop confusion when changing page after making AJAX changes + $PAGE->set_cacheable(false); + preload_course_contexts($course->id); $context = context_course::instance($course->id, MUST_EXIST); diff --git a/index.php b/index.php index e07f11ad685..721c40d38d8 100644 --- a/index.php +++ b/index.php @@ -41,6 +41,9 @@ $PAGE->set_url('/', $urlparams); $PAGE->set_course($SITE); + // Prevent caching of this page to stop confusion when changing page after making AJAX changes + $PAGE->set_cacheable(false); + if ($CFG->forcelogin) { require_login(); } else {