Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-47448

Default course start dates inconsistent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.6.5
    • Fix Version/s: None
    • Component/s: Administration, Course
    • Labels:
    • Testing Instructions:
      Hide

      As admin:

      • 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.
      Show
      As admin: 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.
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      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.

      $mform->setDefault('startdate', time() + 3600 * 24);
      

      http://git.moodle.org/gw?p=moodle.git;a=blob;f=course/edit_form.php;hb=HEAD#l121

      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?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              schach Heiko Schach
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: