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

Incorrect number of query parameters while listing users by student

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-79635-403
    • Hide
      1. Log in as admin
      2. Create a test user
      3. Create a course
        • Group mode: Separate groups
      4. Enrol user in the course
      5. Create a new group
        • Group name: Visible group
      6. Add user to the group
      7. Create another group
        • Group name: Hidden group
        • Group membership visibility: Hidden
      8. Log out
      9. Log in as test user
      10. Navigate to course
      11. Press Participants
      12. Confirm there is no DML exception about "Incorrect number of query parameters"
      13. Confirm members of Visible group are shown in participants list
      Show
      Log in as admin Create a test user Create a course Group mode: Separate groups Enrol user in the course Create a new group Group name: Visible group Add user to the group Create another group Group name: Hidden group Group membership visibility: Hidden Log out Log in as test user Navigate to course Press Participants Confirm there is no DML exception about " Incorrect number of query parameters " Confirm members of Visible group are shown in participants list

      I have a weird problem with incorrect query parameters. I thought it was only Moodle 4.3 related, but no. I reverted to Moodle 4.2.3, and I have the same. Before 4.2.3, users didn't have this problem, but maybe it's Log in as a bug. It occurs only when in the course is additional group with Group membership visibility
      set to Hidden and unchecked Show group in dropdown menu for activities in group mode. I had this group before 4.2.3 and it worked fine (not tested as Log in as).

      The issue description is not as strict as I would like, but I tried to provide as many details as possible. I hope it will useful to fix it.

      1. Select a user with a group
      2. Click Log in as in the user course profile
      3. Open Participants

       

      ERROR: Incorrect number of query parameters. Expected 21, got 16.
      More information about this error
      https://docs.moodle.org/402/en/error/moodle/invalidqueryparam
      Debug info:
      Error code: invalidqueryparam×Dismiss this notification
      Stack trace:
      line 953 of /lib/dml/moodle_database.php: dml_exception thrown
      line 1370 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->fix_sql_params()
      line 1679 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1752 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1963 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
      line 148 of /user/classes/table/participants_search.php: call to moodle_database->count_records_sql()
      line 410 of /user/classes/table/participants.php: call to core_user\table\participants_search->get_total_participants_count()
      line 2191 of /lib/tablelib.php: call to core_user\table\participants->query_db()
      line 213 of /user/classes/table/participants.php: call to table_sql->out()
      line 181 of /user/index.php: call to core_user\table\participants->out()
      

       

            pholden Paul Holden
            lukasz Łukasz Szeremeta
            Huong Nguyen Huong Nguyen
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 57 minutes
                1h 57m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.