Moodle
  1. Moodle
  2. MDL-32510

No log entry is produced when a teacher unenrols a student manually

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.2
    • Fix Version/s: BACKEND
    • Component/s: Enrolments, Logging
    • Labels:
    • Testing Instructions:
      Hide

      visit course administration->users->enrolled users
      unenrol any user by clicking "unenrol" in the column "Enrollment methods".
      View latest log in mdl_log --> you will not find any hint.

      Show
      visit course administration->users->enrolled users unenrol any user by clicking "unenrol" in the column "Enrollment methods". View latest log in mdl_log --> you will not find any hint.
    • Workaround:
      Hide

      Could be changed by adding add_to_log(...);

      enrol/unenroluser.php line:69f

      if ($confirm && confirm_sesskey()) {
          $plugin->unenrol_user($instance, $ue->userid);
      	add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere!
          redirect($returnurl);
      }

      Show
      Could be changed by adding add_to_log(...); enrol/unenroluser.php line:69f if ($confirm && confirm_sesskey()) { $plugin->unenrol_user($instance, $ue->userid); add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere! redirect($returnurl); }
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      If a teacher unenrolls a student while viewing course administration->users->enrolled users, no log entry is produced. This can be a problem when users are unenrolled and the agent can not be identified.

      While self unenrollment produces a log entry (enrol/manual/unenrolself.php:line 54), unenrollment by staff (enrol/unenroluser.php:line 69f) will not produce any logging.

      Could be changed by adding add_to_log(...);

      enrol/unenroluser.php line:69f

      if ($confirm && confirm_sesskey()) {
          $plugin->unenrol_user($instance, $ue->userid);
      	add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere!
          redirect($returnurl);
      }

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Petr Skoda added a comment -

            thanks for the report and patch proposal

            Show
            Petr Skoda added a comment - thanks for the report and patch proposal
            Hide
            Josh Marshall added a comment -

            This also affects 23 Stable, 24 Stable, and 25 Stable at least.

            Show
            Josh Marshall added a comment - This also affects 23 Stable, 24 Stable, and 25 Stable at least.
            Hide
            Mark Nelson added a comment -

            This is no longer an issue in the supported versions of Moodle with the introduction of the new events API in 2.6. Closing this as "Won't fix".

            Show
            Mark Nelson added a comment - This is no longer an issue in the supported versions of Moodle with the introduction of the new events API in 2.6. Closing this as "Won't fix".

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: