Merge branch 'MDL-83990-405' of https://github.com/paulholden/moodle into MOODLE_405_STABLE
This commit is contained in:
@@ -979,6 +979,14 @@ class core_course_external extends external_api {
|
||||
throw new moodle_exception('errorinvalidparam', 'webservice', '', 'shortname');
|
||||
}
|
||||
|
||||
// Make sure start/end date are correctly set.
|
||||
if (!array_key_exists('startdate', $course)) {
|
||||
$course['startdate'] = usergetmidnight(time());
|
||||
}
|
||||
if (!array_key_exists('enddate', $course) && $courseconfig->courseenddateenabled) {
|
||||
$course['enddate'] = $course['startdate'] + $courseconfig->courseduration;
|
||||
}
|
||||
|
||||
// Make sure lang is valid
|
||||
if (array_key_exists('lang', $course)) {
|
||||
if (empty($availablelangs[$course['lang']])) {
|
||||
|
||||
Reference in New Issue
Block a user