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

enrol/database - sync_enrolments exits pre-maturely.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.5, 2.3, 2.4
    • 2.2.6, 2.3.3
    • Enrolments
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • master_MDL-35562
    • 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.

    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.

      Attachments

        Issue Links

          Activity

            People

              danmarsden Dan Marsden
              danmarsden Dan Marsden
              Dan Poltawski Dan Poltawski
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tim Barker Tim Barker
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Nov/12