Moodle
  1. Moodle
  2. MDL-25936

upload enrolments fails if manual enrol plugin is not first in sortorder

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Enrolments
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      When uploading users via CSV, if any of the courses have a non-manual plugin with the lowest sortorder, Moodle will throw an exception:
      throw new coding_exception('invalid enrol instance!');

      Stack trace:
      line 1011 of /lib/enrollib.php: coding_exception thrown
      line 717 of /admin/uploaduser.php: call to enrol_plugin->enrol_user()

      The problem appears to be that admin/uploaduser.php builds its $manualcache list by assuming that the first element returned from enrol_get_instances() is a manual plugin. However this is not always the case (especially since there is a user interface for reordering enrolment plugins).

      It should be fixed to search the list for enrol == 'manual'.

        Gliffy Diagrams

          Activity

          Hide
          Petr Skoda added a comment -

          thanks for the report!

          Show
          Petr Skoda added a comment - thanks for the report!
          Hide
          Helen Foster added a comment -

          Thanks Ashley and Petr.

          Show
          Helen Foster added a comment - Thanks Ashley and Petr.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: