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

user_unenrolled event flag wrong

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Enrolments
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      In lib/enrollib.php:public function unenrol_user()

      if ($DB->record_exists_sql($sql, array('userid'=>$userid, 'courseid'=>$courseid))) {
          $ue->lastenrol = false;
          events_trigger('user_unenrolled', $ue);
          // user still has some enrolments, no big cleanup yet
      } else {
          // REMOVED CODE
       
          $ue->lastenrol = false;
          events_trigger('user_unenrolled', $ue);
      }

      I believe that at around line 1022, the code should be $ue->lastenrol = true; as I think it's removing the user's last enrollment for the course.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            bushido Mark Nielsen
            Tester:
            Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10