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

No Sections created in Database Enrolment when not using a Template course

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.4, 3.4.1
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide

      Set up

      • Access as an admin.
      • Go to Site Administration -> Plugins -> Manage Enrol Plugins and enable external database.
      • Click settings next to "External Database" . Fill in the details for external database course sync.
      • Go to Site administration -> Courses -> Course default settings and change the "Number of sections" to 5.
      • Go to Site administration -> Courses -> Course default settings and ensure the "Format" is "Topics format".

      Testing scenario

      1) In the remote database, add a record that contains a value for course column that does not exists in Moodle, so that you can trigger creation of the course.

      2) From command line, execute "/usr/bin/php /path/to/moodle/enrol/database/cli/sync.php".

      • Check the newly created course has exatcly 5 sections. 
      Show
      Set up Access as an admin. Go to Site Administration -> Plugins -> Manage Enrol Plugins and enable external database. Click settings next to "External Database" . Fill in the details for external database course sync. Go to Site administration -> Courses -> Course default settings and change the "Number of sections" to 5. Go to Site administration -> Courses -> Course default settings and ensure the "Format" is "Topics format". Testing scenario 1) In the remote database, add a record that contains a value for course column that does not exists in Moodle, so that you can trigger creation of the course. 2) From command line, execute "/usr/bin/php /path/to/moodle/enrol/database/cli/sync.php". Check the newly created course has exatcly 5 sections. 
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-61265-master

      Description

      When courses are created through Database Enrolment, with no Template course, no Sections (Topics) are created in the course. This is unlike creating a course manually where the site-wide configured default number of sections are created.

      Steps to reproduce:

      • Check Site Administration -> Courses -> Course Default Settings
        • Format: Topics Format
        • Number of Sections: 20 (or default 4, or any number greater than zero)
      • Set up Database Enrolment to create a new course on sync as per Database Enrolment: Creating Courses testing processes
        • Under Site Administration -> Plugins -> Enrolments -> External database, check:
          • Creation of new courses -> New Course Template: (empty)
      • Run Database Enrolment sync (CLI: php /path/to/moodle/enrol/database/cli/sync.php -v)

      Expected Result:

      • New course created with 20 empty sections

      Actual Result:

      • New course created with only the header section (section zero)

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  17/May/18