MDL-63583 course: Include course/lib.php always
authorJuan Leyva <juanleyvadelgado@gmail.com>
Mon, 8 Oct 2018 14:32:15 +0000 (16:32 +0200)
committerJuan Leyva <juanleyvadelgado@gmail.com>
Mon, 8 Oct 2018 14:32:15 +0000 (16:32 +0200)
core_course_get_courses_by_field WS must include always course/lib.php to not depend on functions including it.

course/externallib.php

index b7cabe7..5fa41e1 100644 (file)
@@ -3014,6 +3014,7 @@ class core_course_external extends external_api {
      */
     public static function get_courses_by_field($field = '', $value = '') {
         global $DB, $CFG;
+        require_once($CFG->dirroot . '/course/lib.php');
         require_once($CFG->libdir . '/filterlib.php');
 
         $params = self::validate_parameters(self::get_courses_by_field_parameters(),