mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-62011 course: Approval of a course request fails
This commit is contained in:
parent
6fa694bef0
commit
9f9d7bbe87
@ -2988,6 +2988,8 @@ class course_request {
|
||||
public function approve() {
|
||||
global $CFG, $DB, $USER;
|
||||
|
||||
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
|
||||
|
||||
$user = $DB->get_record('user', array('id' => $this->properties->requester, 'deleted'=>0), '*', MUST_EXIST);
|
||||
|
||||
$courseconfig = get_config('moodlecourse');
|
||||
@ -3022,6 +3024,8 @@ class course_request {
|
||||
$data->enddate = usergetmidnight(time()) + $courseconfig->courseduration;
|
||||
}
|
||||
|
||||
list($data->fullname, $data->shortname) = restore_dbops::calculate_course_names(0, $data->fullname, $data->shortname);
|
||||
|
||||
$course = create_course($data);
|
||||
$context = context_course::instance($course->id, MUST_EXIST);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user