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:33:59 +0000 (15:33 +0800)
enrol/paypal/return.php

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