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

Users Online Block not showing number of users online correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.4, 1.9.5
    • Fix Version/s: 1.9.7
    • Component/s: Blocks
    • Labels:
      None
    • Environment:
      Linux
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      blocks/online_users/block_online_users.php - line:119

      This SQL query would always return 1 (number of instances the first userid in the returned SQL)

      $usercount = count_records_sql("SELECT COUNT(u.id), u.id $from $where GROUP BY u.id");

      The patch counts the distinct userids to correctly return the real userc ount. :-

      $usercount = count_records_sql("SELECT COUNT(DISTINCT(u.id)) $from $where");

        Attachments

          Activity

            People

            Assignee:
            andyjdavis Andrew Davis
            Reporter:
            tlock Tim Lock
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              25/Nov/09