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.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2, 2.2
    • 2.0.7, 2.1.4, 2.2.1
    • Enrolments
    • None
    • Any
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • w50_MDL-30528_m23_enrolroleid
    • Hide

      Included in the attached patch file.

      Show
      Included in the attached patch file.
    • 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)) {"

    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.

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              luis.alcantara Luis Gustavo Mueller de Alcantara
              Sam Hemelryk Sam Hemelryk
              Sam Hemelryk Sam Hemelryk
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jan/12