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

Searching for users in messaging with multiple roles generates a warning

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2, 2.3
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Messages
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      Enrol a user in a course (if they arent already)
      Go to the enrolled users screen for that course and give that user a second role (click the + sign in the role column)
      Go to messages and go to advanced search
      Tick "Only in my courses" and search for the name of the user with 2 roles.
      Check that you don't get any error.

      Remove the user's 2nd role and repeat the search. Check that you still don't get any error.

      (suggestion: test on more than 1 DB type)

      Show
      Enrol a user in a course (if they arent already) Go to the enrolled users screen for that course and give that user a second role (click the + sign in the role column) Go to messages and go to advanced search Tick "Only in my courses" and search for the name of the user with 2 roles. Check that you don't get any error. Remove the user's 2nd role and repeat the search. Check that you still don't get any error. (suggestion: test on more than 1 DB type)
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-31869_message_search_roles

      Description

      If you search for user x and they have multiple roles like student and teacher you will get this error relating to their user id a duplicate in the returning SQL.

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '4' found in column 'id'.
      line 705 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
      line 1515 of /message/lib.php: call to pgsql_native_moodle_database->get_records_sql()
      line 1034 of /message/lib.php: call to message_search_users()
      line 653 of /message/lib.php: call to message_print_search_results()
      line 300 of /message/index.php: call to message_print_search()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12