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

Incorrect user deletes and updates in ims enterprise auth plugin

XMLWordPrintable

    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • w22_MDL-39802_m26_deletedusers
    • Hide

      1/ execute phpunit tests in 25 and master branches
      2/ test enrol_meta cli sync in all affected branches (<= 24)
      3/ test imsenterprise user creating and deleting in all branches
      4/ edit deleted flag for some users directly in database
      5/ execute the new admin/cli/fix_deleted_users.php script and verify the users were deleted properly (this means the username and idnumber should be cleaned and user data like role_assignments deleted).

      Show
      1/ execute phpunit tests in 25 and master branches 2/ test enrol_meta cli sync in all affected branches (<= 24) 3/ test imsenterprise user creating and deleting in all branches 4/ edit deleted flag for some users directly in database 5/ execute the new admin/cli/fix_deleted_users.php script and verify the users were deleted properly (this means the username and idnumber should be cleaned and user data like role_assignments deleted).

      I've noticed a bug when enrolling deleted users via a meta enrolment.

      Consider user U in course A, enrolled as a manual enrolment and the user account is all ok.

      For some reason, user U's account becomes marked as deleted.
      (in our setup, users are added via the LDAP enrolment plugin, set to "Keep internal" if the external user disappears)

      If you then go to course B and add a meta enrolment back to course A (ie. those in course A are also enroled in course B), the procedure fails. The meta plugin only adds a subset of users to course A, and diplays the following error:

      Coding error detected, it must be fixed by a programmer: User ID does not exist or is deleted!

      More information about this error
      Debug info: userid:68583
      Error code: codingerror
      Stack trace:

      line 1610 of /lib/accesslib.php: coding_exception thrown
      line 1311 of /lib/enrollib.php: call to role_assign()
      line 465 of /enrol/meta/locallib.php: call to enrol_plugin->enrol_user()
      line 56 of /enrol/meta/addinstance.php: call to enrol_meta_sync()

      Final note. I can see why this occurs, Moodle can't find the user account in order to add them to the second course. But IMHO Moodle should continue to add the valid users and display a summary/error at the end of the procedure; rather than aborting in a semi-enrolled state.

            skodak Petr Skoda
            fireoxx74 Ben Steeples
            Damyon Wiese Damyon Wiese
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.