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

database enrolment unenrols manual enroled people

    Details

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

      Description

      Database enrolments appears to remove people you have added manually. This is easily corrected with the new database field 'enrol'. Changing the call to enrol_student and checking for that before you call unenrol_student will prevent the problem.

      enrol_student($user->id, $course->id, 0, 0, 'database'); /// Enrol the student

      // only unenrol if the person was a database enrolee, auto won't remove a manual enrol

      $selection = userid = .$user->id. and enrol = 'database';

      if(get_record_select(user_students,$selection))

      { unenrol_student($user->id, $courseid); /// Unenrol the student unset($user->student[$course->id]); /// Remove from old list }

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: