MDL-35349 paypal: Fixing return page so that it now declares page context
authorMark Nelson <markn@moodle.com>
Fri, 2 Nov 2012 07:32:36 +0000 (15:32 +0800)
committerMark Nelson <markn@moodle.com>
Fri, 2 Nov 2012 07:35:24 +0000 (15:35 +0800)
enrol/paypal/return.php

index 8135716..e8a5c84 100644 (file)
@@ -35,10 +35,11 @@ if (!$course = $DB->get_record("course", array("id"=>$id))) {
 }
 
 $context = context_course::instance($course->id, MUST_EXIST);
+$PAGE->set_context($context);
 
 require_login();
 
-if ($SESSION->wantsurl) {
+if (!empty($SESSION->wantsurl)) {
     $destination = $SESSION->wantsurl;
     unset($SESSION->wantsurl);
 } else {