Merge branch 'MDL-65965-master-fix' of git://github.com/junpataleta/moodle

This commit is contained in:
Andrew Nicols 2019-07-09 10:59:14 +08:00
commit c30d15814a

View File

@ -806,6 +806,11 @@ class behat_data_generators extends behat_base {
protected function get_grouping_id($idnumber) {
global $DB;
// Do not fetch grouping ID for empty grouping idnumber.
if (empty($idnumber)) {
return null;
}
if (!$id = $DB->get_field('groupings', 'id', array('idnumber' => $idnumber))) {
throw new Exception('The specified grouping with idnumber "' . $idnumber . '" does not exist');
}