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

Online Users Block (with partial fix)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.8.3
    • 1.8
    • Blocks
    • None
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE

      When a user logs in, it doesn't always show them in the online users block. Sometimes they have to enter a course to finally show up on the site online users block. I tested my system by logging in 20 test users, and I was only getting 9 of them to show up. After making the following code change, the users seem to all be there.

      $SQL = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, ul.timeaccess
      FROM {$CFG->prefix}user_lastaccess ul,
      {$CFG->prefix}user u
      $groupmembers
      WHERE
      ul.userid = u.id
      $courseselect
      $timeselect
      $groupselect
      ORDER BY ul.timeaccess DESC";

      to

      $SQL = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, u.lastaccess, ul.timeaccess
      FROM {$CFG->prefix}user_lastaccess ul,
      {$CFG->prefix}user u
      $groupmembers
      WHERE
      ul.userid = u.id
      $courseselect
      $timeselect
      $groupselect
      GROUP BY u.id
      ORDER BY ul.timeaccess DESC";

            lazyfish Yu Zhang
            syxton Matthew Davidson
            Nobody Nobody
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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