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

enrol/database - sync_enrolments exits pre-maturely.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide

      set up an external table for user enrolment sync - for the course idnumber field use an integer based field in the external db

      create some courses in moodle with char based idnumber

      run the sync process - it should continue when it gets to a course with a char in the idnumber.

      Show
      set up an external table for user enrolment sync - for the course idnumber field use an integer based field in the external db create some courses in moodle with char based idnumber run the sync process - it should continue when it gets to a course with a char in the idnumber.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull Master Branch:
      master_MDL-35562

      Description

      sync_enrolments has this function which tries to get a list of users for "this" course to enrol

                  $sql = $this->db_get_sql($table, array($coursefield=>$course->mapping), $sqlfields);
                  if ($rs = $extdb->Execute($sql)) {
      ...
                  } else {
                      mtrace('Error while communicating with external enrolment database');
                      $extdb->Close();
                      return;
                  }

      problem is if the idnumber in a course contains something that would cause the sql to fail - eg char instead of expected int - the enrolment process halts at this point and stops any further enrolment.

      it would be better to "continue" at this point instead of close/return.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12