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

Mutliple Roles Error: "Found more than one record in get_record_sql"

    XMLWordPrintable

    Details

    • Database:
      MySQL
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE

      Description

      We're in the process of testing out the upgrade to 1.7.1. After doing the upgrade from 1.7.0, I'm seeing a new error in debugging mode when I log in as a student who has more than one role (specifically the "student" role and a custom "student assistant" role we created.

      Here's the SQL error:

      ---------------
      Error: Turn off debugging to hide this error.

      SELECT * FROM mdl_role_assignments WHERE contextid = '153' AND userid = '35'(with limits 0, 100)

      Found more than one record in get_record_sql !

      Array
      (
      [421] => Array
      (
      [roleid] => 7
      [contextid] => 153
      [userid] => 35
      [hidden] => 0
      [timestart] => 0
      [timeend] => 0
      [timemodified] => 1169486964
      [modifierid] => 4
      [enrol] => manual
      [sortorder] => 0
      )

      [422] => Array
      (
      [roleid] => 5
      [contextid] => 153
      [userid] => 35
      [hidden] => 0
      [timestart] => 0
      [timeend] => 0
      [timemodified] => 1169487058
      [modifierid] => 35
      [enrol] => manual
      [sortorder] => 0
      )
      )

      ---------------

      So far, it does not seem like its having any adverse effect other than generating the error code, but I'm willing to bet that's just a happy accident based on how the fact that the "student assistant" role is the first result returned by the query (roleid #7 is the student assistant; roleid #5 is the default student one). Had their roles been reversed, I'm guessing the student wouldn't have the right permissions in the course.

      Is anyone else seeing this error?

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            lafayettenuke Kenneth Newquist
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Mar/07