Skip to content

Commit

Permalink
MDL-32881 Prevent course/view.php from being cached
Browse files Browse the repository at this point in the history
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 3aaa184.
  • Loading branch information
Sam Hemelryk committed May 16, 2012
1 parent ea01d3c commit fbb4c95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions course/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 3 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit fbb4c95

Please sign in to comment.