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

Chat activity using groups error reading from database



    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Duplicate
    • 2.0.1
    • None
    • Chat, Groups
    • LAMP, Moodle 2.0.1
    • MySQL


      the chat activity is not accessible and displays 'Error reading from database' for users who are members of a group. if groups is forced via course settings and the said user is enrolled in a group, they receive the above message.

      the chat activity works fine when a student is either not in a group or when the activity is not in group mode.

      work around appears to be to NOT force groups in course settings ie. chat activity without groups or else not add users to groups at all.

      To replicate:

      1. Go to Course > Settings block > Course admin > Course settings
      2. Set as follows:
      Group: Separate
      Force: Yes
      3. Create a group via Users > Groups
      4. Enrol a test user in group
      5. Create chat activity and check it is in group mode
      6. Login as test user and go to chat activity

      Debugging outputs the following...

      Error reading from database

      More information about this error

      Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM mdl_groups WHERE id = '61'' at line 1
      SELECT FROM mdl_groups WHERE id = ?
      [array (
      0 => '61',
      Stack trace:
      line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 769 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 1256 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      line 1228 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      line 1208 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 122 of /lib/grouplib.php: call to moodle_database->get_record()
      line 36 of /mod/chat/gui_header_js/index.php: call to groups_get_group()


        Issue Links



              dongsheng Dongsheng Cai
              chadsta Chad Outten
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona), Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              2 Vote for this issue
              3 Start watching this issue