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

Course search results in debugging notice

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.2
    • 2.2
    • Course
    • None
    • Any
    • MOODLE_21_STABLE
    • MOODLE_22_STABLE
    • Hide

      SETUP:
      1/ Create a course named 'test'
      2/ Enrol a test user as a teacher, also add the 'non editting teacher' role to them at course context
      3/ Go to Admin -> Appearance -> Course contacts and select 'non editing teacher' in addition to 'teacher'

      TEST A:
      Run the course search for 'test'
      TEST B:
      View the category which course 'test' is displayed in.

      EXPECTED RESULT
      The course is displayed with the test user listed as a course contact, displaying the role

      ACTUAL RESULT

      The course is displayed fine with the user displayed in TEST B, but in TEST A:

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'id'.
      line 705 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
      line 5257 of /lib/accesslib.php: call to pgsql_native_moodle_database->get_records_sql()
      line 2447 of /course/lib.php: call to get_role_users()
      line 232 of /course/search.php: call to print_course()

      Show
      SETUP: 1/ Create a course named 'test' 2/ Enrol a test user as a teacher, also add the 'non editting teacher' role to them at course context 3/ Go to Admin -> Appearance -> Course contacts and select 'non editing teacher' in addition to 'teacher' TEST A: Run the course search for 'test' TEST B: View the category which course 'test' is displayed in. EXPECTED RESULT The course is displayed with the test user listed as a course contact, displaying the role ACTUAL RESULT The course is displayed fine with the user displayed in TEST B, but in TEST A: Did you remember to make the first column something unique in your call to get_records? Duplicate value '3' found in column 'id'. line 705 of /lib/dml/pgsql_native_moodle_database.php: call to debugging() line 5257 of /lib/accesslib.php: call to pgsql_native_moodle_database->get_records_sql() line 2447 of /course/lib.php: call to get_role_users() line 232 of /course/search.php: call to print_course()

    Description

      If a user has two 'coursecontact' roles assigned at course context, the course search results in a debugging notice. Due to MDL-22309

      Attachments

        Issue Links

          Activity

            People

              poltawski Dan Poltawski
              poltawski Dan Poltawski
              Sam Hemelryk Sam Hemelryk
              Ankit Agarwal Ankit Agarwal
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5/Dec/11