[multienrol]Some database upgrade to preserve the default enrolment plugin
This commit is contained in:
@@ -1403,6 +1403,12 @@ function main_upgrade($oldversion=0) {
|
||||
|
||||
if ($oldversion < 2006030900) {
|
||||
table_column('course','','enrol','varchar','20','','');
|
||||
set_config('enrol_plugins_enabled', $CFG->enrol);
|
||||
require_once("$CFG->dirroot/enrol/enrol.class.php");
|
||||
$defaultenrol = enrolment_factory::factory($CFG->enrol);
|
||||
if (!method_exists($defaultenrol, 'print_entry')) { // switch enrollable to off for all courses in this case
|
||||
modify_database('', 'UPDATE prefix_couse SET enrollable = 0');
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user