Affects Version/s: 2.6.5
Fix Version/s: BACKEND
- Go to "Courses > Pending requests > Courses pending approval" and approve a pending course request.
- Go to "Courses > Manage courses and categories", click on some category, click the "New course" link.
- Notice the different defaults for course start date.
On our site, we create courses in two ways: approving pending course requests and adding courses manually.
When approving a course from "Courses > Pending requests > Courses pending approval", the default "Course start date" is today. In my opinion this is how it should work.
When creating a course the regular way in "Courses > Manage courses and categories" as described in https://docs.moodle.org/en/admin/setting/courserequest#Adding_a_course, the default "Course start date" is set to the next day. Some of our course creators have found this confusing.
It seems that course/edit.php handles course start date differently depending on which parameters are passed, in other words whether there is an entry in mdl_course or not.
When approving a course request, an entry is created in mdl_course with startdate=0. The course id is passed in the URL (course/edit.php?id=xxx) and the page displayed next is "Edit course settings", where "Course start date" is set to today.
When creating a new course, no mdl_course entry exists at this point. The category id is passed (course/edit.php?category=xxx&returnto=catmanage) and the page heading is "Add a new course". There is no value for startdate, $course is null.
I had a look at the course/edit_form.php and found this line which, in some form or another, has been there for ages.
Is there any reason for not having a new course start immediately but the next day? And if there is, could this behavior be applied to pending courses as well?