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

Error reading from database when user bulk action or browse


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
    • Environment:
      Ubuntu 10.04 server
    • Database:
    • Affected Branches:


      Using moodle 2.0 preview 4 (build 20100829)

      I went to administration -> users -> accounts -> bulk user actions

      I wanted to enroll all students who were in one class into another class.

      I clicked advanced to filter users who were enrolled in the first class.

      And now it just gives an "Error reading from database" - even if I just click on the link
      to browse users, or if I click again on the link to bulk user actions.

      I enabled more verbose debugging and got these errors:

      Notice: Undefined variable: CFG in /var/www/moodle/admin/user/lib.php on line 28
      Notice: Trying to get property of non-object in /var/www/moodle/admin/user/lib.php on line 28
      Notice: Undefined variable: CFG in /var/www/moodle/admin/user/lib.php on line 30
      Notice: Trying to get property of non-object in /var/www/moodle/admin/user/lib.php on line 30

      and the developer debugging output when clicking bulk user actions:

      Debug info: Unknown column 'a.timestart' in 'where clause'
      SELECT COUNT('x') FROM mdl_user WHERE id<>? AND deleted <> 1 AND id IN (SELECT userid
      FROM mdl_role_assignments a
      INNER JOIN mdl_context b ON a.contextid=b.id
      INNER JOIN mdl_course c ON b.instanceid=c.id
      WHERE b.contextlevel=50 AND a.timestart<1283693769 AND (a.timeend=0 OR a.timeend>1283693769) AND c.category=2)
      [array (
      0 => NULL,
      Stack trace:
          line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 732 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1237 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
          line 1312 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
          line 1483 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
          line 1466 of /lib/dml/moodle_database.php: call to moodle_database->count_records_sql()
          line 31 of /admin/user/lib.php: call to moodle_database->count_records_select()
          line 32 of /admin/user/user_bulk.php: call to get_selection_data()

        Gliffy Diagrams


            Issue Links



                • Votes:
                  1 Vote for this issue
                  1 Start watching this issue


                  • Created: