From fbb4c959b5f3fed091052fecdab50bd73f7a8fd5 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 17 May 2012 10:09:27 +1200 Subject: [PATCH] MDL-32881 Prevent course/view.php from being cached This should prevent browser caching which will ensure that changes made using the course javascript (e.g. drag/drop, show/hide) will not be 'lost' by using the browser back button. This reverts commit 3aaa1843999eeb1832331ec5c8b30865fdba9710. --- course/lib.php | 3 --- course/view.php | 3 +++ index.php | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) 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 {