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

External database enrolment plugin is recreating role_assignments on every login attempt for each user.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.2, 2.2
    • Fix Version/s: 2.0.7, 2.1.4, 2.2.1
    • Component/s: Enrolments
    • Labels:
      None
    • Database:
      Any
    • Testing Instructions:
      Hide

      Enable external database authentication, also external database enrolment, create some data to the external database, and make some logins throught a user using this method. You should see the role_assignmets table recreating the instances on every login.

      The error I found is uppon line 186 @ /enrol/database/lib.php.
      Where it reads:
      "if (in_array($r->id, $roles)) {"
      it should be
      "if (in_array($r->roleid, $roles)) {"

      Show
      Enable external database authentication, also external database enrolment, create some data to the external database, and make some logins throught a user using this method. You should see the role_assignmets table recreating the instances on every login. The error I found is uppon line 186 @ /enrol/database/lib.php. Where it reads: "if (in_array($r->id, $roles)) {" it should be "if (in_array($r->roleid, $roles)) {"
    • Workaround:
      Hide

      Included in the attached patch file.

      Show
      Included in the attached patch file.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w50_MDL-30528_m23_enrolroleid

      Description

      When we enable External Database Enrolment, every role_assignmet is reset for each user, each time he logs in. The result of this bug is an unnecessary increasing ID on table role_assignments.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jan/12