Skip to content

Commit

Permalink
MDL-55405 enrol_paypal: Fix set_context() call
Browse files Browse the repository at this point in the history
Note that setting the page context more than once is not ideal
but as far as system->course switches are allowed, this should
not hurt, while providing more accurate messages than keeping
system context.
  • Loading branch information
stronk7 committed Sep 20, 2016
1 parent 43f53de commit 73b2a94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion enrol/paypal/ipn.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@
die;
}

// Now that the course/context has been validated, we can set it. Not that it's wonderful
// to set contexts more than once but system->course switches are accepted.
// Required for message_send.
$PAGE->set_context(context_course::instance($context));
$PAGE->set_context($context);

if (! $plugin_instance = $DB->get_record("enrol", array("id"=>$data->instanceid, "status"=>0))) {
\enrol_paypal\util::message_paypal_error_to_admin("Not a valid instance id", $data);
Expand Down

0 comments on commit 73b2a94

Please sign in to comment.