MDL-67845 enrol_database: Use course category selection setting
authorMihail Geshoski <mihail@moodle.com>
Wed, 6 May 2020 02:23:53 +0000 (10:23 +0800)
committerMihail Geshoski <mihail@moodle.com>
Wed, 6 May 2020 02:50:05 +0000 (10:50 +0800)
We should use admin_settings_coursecat_select instead of
enrol_database_admin_setting_category as the second class is only
being used by the database enrolment plugin settings and can be
removed after this change.

enrol/database/settings.php

index f5dde91..28c7504 100644 (file)
@@ -111,9 +111,9 @@ if ($ADMIN->fulltree) {
 
     $settings->add(new admin_setting_configtext('enrol_database/newcoursecategory', get_string('newcoursecategory', 'enrol_database'), '', ''));
 
-    require_once($CFG->dirroot.'/enrol/database/settingslib.php');
-
-    $settings->add(new enrol_database_admin_setting_category('enrol_database/defaultcategory', get_string('defaultcategory', 'enrol_database'), get_string('defaultcategory_desc', 'enrol_database')));
+    $settings->add(new admin_settings_coursecat_select('enrol_database/defaultcategory',
+        get_string('defaultcategory', 'enrol_database'),
+        get_string('defaultcategory_desc', 'enrol_database'), 1));
 
     $settings->add(new admin_setting_configtext('enrol_database/templatecourse', get_string('templatecourse', 'enrol_database'), get_string('templatecourse_desc', 'enrol_database'), ''));
 }