Moodle
  1. Moodle
  2. MDL-24086

Error reading from database when user bulk action or browse

    Details

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

      Description

      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()
      
      

        Issue Links

          Activity

          Doug Holton created issue -
          Martin Dougiamas made changes -
          Field Original Value New Value
          Workflow jira [ 38513 ] MDL Workflow [ 46716 ]
          Dan Poltawski made changes -
          Assignee moodle.com [ moodle.com ] Dan Poltawski [ poltawski ]
          Dan Poltawski made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Dan Poltawski made changes -
          Link This issue duplicates MDL-25657 [ MDL-25657 ]
          Martin Dougiamas made changes -
          Workflow MDL Workflow [ 46716 ] MDL Full Workflow [ 94796 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: