From e797476fd2f92a3b9a9b9a6a98a2eba68ae351a4 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Tue, 18 Oct 2011 11:02:00 +1300 Subject: [PATCH] MDL-29695 enrol-cohort: Minor code improvement --- enrol/cohort/locallib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) { -- 2.43.0