Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-7789

Error reading from database when viewing overview of students with multiple groups in course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 3.5.7
    • None
    • 2019071100
    • MOODLE_35_STABLE

      We updated to the most recent version of completion progress and are using Moodle 3.5.7 right now. The overview works normally except for teachers but we have a type of teacher role we created called 'Group-restricted Non-editing teacher' that gives an "Error reading from database" when a person with that role tries to view the overview. The problem appears to be the line in MySQL: "g.groupid IN (group-879,group-565,group-563,group-1076,group-774,group-880,group-599,group-564)"

      Removing the word 'group' from the IN, so that it becomes "g.groupid IN (879,565,563,1076,774,880,599,564)" looks to work, but I'm not sure where it's coming in from. It's definitely the new grouping code on line 179 or 183 of overview.php, but I don't see anything so far as to why it would prefix group- in front of the group id number.

       

      Error details below:

       
      Error reading from database

       
      ×Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'group-879,group-565,group-563,group-1076,group-774,group-880,group-599,group-564' at line 4
      SELECT DISTINCT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email, COALESCE(l.timeaccess, 0) AS lastonlinetime
      FROM mdl_user u
      JOIN mdl_role_assignments a ON (a.contextid = ? AND a.userid = u.id AND a.roleid = 5)
      JOIN mdl_groups_members g ON (g.groupid IN (group-879,group-565,group-563,group-1076,group-774,group-880,group-599,group-564) AND g.userid = u.id)
      LEFT JOIN mdl_user_lastaccess l ON (l.courseid = ? AND l.userid = u.id)
      [array (
      0 => 51102,
      1 => '1340',
      )]
      Error code: dmlreadexception
      ×Stack trace: * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown

      • line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 197 of /blocks/completion_progress/overview.php: call to mysqli_native_moodle_database->get_records_sql()
         

            salvetore Michael de Raadt
            mgancarzdsi Mathew Gancarz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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