commit 4fd7936e67a6511ee6997efd5a24b40bb25dac0f Author: Ali Abdulrahman Date: Mon Sep 17 12:43:28 2018 +0200 Fixing bug in instantiation of moodle_exception diff --git a/enrol/manual/externallib.php b/enrol/manual/externallib.php index a9b86d1faa5..b14dddfc744 100644 --- a/enrol/manual/externallib.php +++ b/enrol/manual/externallib.php @@ -202,7 +202,7 @@ class enrol_manual_external extends external_api { require_capability('enrol/manual:unenrol', $context); $instance = $DB->get_record('enrol', array('courseid' => $enrolment['courseid'], 'enrol' => 'manual')); if (!$instance) { - throw new moodle_exception('wsnoinstance', 'enrol_manual', $enrolment); + throw new moodle_exception('wsnoinstance', 'enrol_manual', '', $enrolment); } $user = $DB->get_record('user', array('id' => $enrolment['userid'])); if (!$user) { diff --git a/patch.txt b/patch.txt new file mode 100644 index 00000000000..42ad15b0b95 --- /dev/null +++ b/patch.txt @@ -0,0 +1,19 @@ +commit 27f023b1f937057e110641a683b156417250c817 +Author: Ali Abdulrahman +Date: Mon Sep 17 12:40:10 2018 +0200 + + Fixing bug in instantiation of moodle_exception + +diff --git a/enrol/manual/externallib.php b/enrol/manual/externallib.php +index a538ac33429..a9b86d1faa5 100644 +--- a/enrol/manual/externallib.php ++++ b/enrol/manual/externallib.php +@@ -120,7 +120,7 @@ class enrol_manual_external extends external_api { + if (empty($instance)) { + $errorparams = new stdClass(); + $errorparams->courseid = $enrolment['courseid']; +- throw new moodle_exception('wsnoinstance', 'enrol_manual', $errorparams); ++ throw new moodle_exception('wsnoinstance', 'enrol_manual', '', $errorparams); // $link isn't required here + } + + // Check that the plugin accept enrolment (it should always the case, it's hard coded in the plugin).