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

External Enrollment enrol.php v.1.10 calling wrong datalib.php function

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: None
    • Component/s: Enrolments
    • Labels:
      None
    • Environment:
      All
    • Database:
      Any
    • Affected Branches:
      MOODLE_15_STABLE

      Description

      There is a bug in the latest external enrollment enrol.php code version 1.10. I'm not sure if this is scheduled for 1.5.3, or straight to 1.6. The bug results in queries of the form:

      SELECT 22 FROM ...

      due to the wrong datalib.php function being called.

      Around line 74:

      // unenrol only if it's a record pulled from external db

      if (get_record_select('user_students', 'userid', $user->id, 'courseid', $courseid, 'enrol', 'database'))

      The line should be calling the get_record() function which takes field/value pairs and not get_record_select().

      I changed mine to this and it worked:

      // unenrol only if it's a record pulled from external db

      if (get_record('user_students', 'userid', $user->id, 'courseid', $courseid, 'enrol', 'database'))

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: