From: Sam Hemelryk Date: Mon, 17 Oct 2011 22:02:00 +0000 (+1300) Subject: MDL-29695 enrol-cohort: Minor code improvement X-Git-Tag: v2.2.0-beta~200 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=e797476fd2f92a3b9a9b9a6a98a2eba68ae351a4 MDL-29695 enrol-cohort: Minor code improvement --- diff --git a/enrol/cohort/locallib.php b/enrol/cohort/locallib.php index c19b52aacf6..3462638901e 100644 --- a/enrol/cohort/locallib.php +++ b/enrol/cohort/locallib.php @@ -289,8 +289,7 @@ function enrol_cohort_get_cohorts(course_enrolment_manager $manager) { */ function enrol_cohort_can_view_cohort($cohortid) { global $DB; - $cohort = $DB->get_record_select('cohort', 'id = ?', array($cohortid)); - + $cohort = $DB->get_record('cohort', array('id' => $cohortid), 'id, contextid'); if ($cohort) { $context = get_context_instance_by_id($cohort->contextid); if (has_capability('moodle/cohort:view', $context)) {