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

sql error in online block when separate group mode enabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Blocks
    • Labels:
      None
    • Environment:
      Moodle 2.0.1, Linux CentOS, Apache, MySQL 5.0.91, PHP 5.2.14.
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Following debug msg is rcvd when new user tries to access course that they've been manually enrolled in.

      1. Add new user
      2. Manually enrolling them in a course
      3. Login as new user and try access course

      Debug info: Unknown column 'u.id' in 'on clause'
      SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,u.username, MAX(ul.timeaccess) AS lastaccess
      FROM mdl_user_lastaccess ul, mdl_user u , mdl_groups_members gm
      JOIN (SELECT DISTINCT eu1_u.id
      FROM mdl_user eu1_u
      JOIN mdl_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
      JOIN mdl_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = ?)
      WHERE eu1_u.deleted = 0 AND eu1_u.id <> ?) euj ON euj.id = u.id
      WHERE ul.timeaccess > 1295354600
      AND u.id = ul.userid
      AND ul.courseid = ?
      AND u.id = gm.userid AND gm.groupid = ?
      GROUP BY u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email,u.username
      ORDER BY lastaccess DESC LIMIT 0, 50
      [array (
      0 => '7',
      1 => '1',
      2 => '7',
      3 => 0,
      )]
      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 114 of /blocks/online_users/block_online_users.php: call to mysqli_native_moodle_database->get_records_sql()
      line 279 of /blocks/moodleblock.class.php: call to block_online_users->get_content()
      line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      line 895 of /lib/blocklib.php: call to block_base->get_content_for_output()
      line 947 of /lib/blocklib.php: call to block_manager->create_block_contents()
      line 342 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      line 7 of /theme/base/layout/general.php: call to block_manager->region_has_content()
      line 647 of /lib/outputrenderers.php: call to include()
      line 605 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      line 1200 of /lib/setuplib.php: call to core_renderer->header()
      line 196 of /course/view.php: call to bootstrap_renderer->__call()
      line 196 of /course/view.php: call to bootstrap_renderer->header()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  21/Feb/11