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

Online Users block is miss reporting 100's of users online as 1

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2, 2.1.2, 2.2
    • Fix Version/s: 2.0.6, 2.1.3
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide

      1/ Add the online users block to either a course or frontpage
      2/ Get 51 users to visit the course/site [NOTE BELOW]
      3/ Notice the "(last 5 minutes: x)" display

      Expected Result:


      The 'x' should show 51

      Actual result


      The 'x' is showing 1
      Notice the developer warnings about incorrect get_records call as specified in this bug report.

      [NOTE] An alternative way to expose this issue is to apply the patch_to_expose_issue.patch which i've attached. Which ensures the summary mentioned is always displayed

      Show
      1/ Add the online users block to either a course or frontpage 2/ Get 51 users to visit the course/site [NOTE BELOW] 3/ Notice the "(last 5 minutes: x)" display Expected Result: The 'x' should show 51 Actual result The 'x' is showing 1 Notice the developer warnings about incorrect get_records call as specified in this bug report. [NOTE] An alternative way to expose this issue is to apply the patch_to_expose_issue.patch which i've attached. Which ensures the summary mentioned is always displayed
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:

      Description

      Online Users block is miss reporting 100's of users online as 1 because count_records_sql return multiple records with 1 and generates this error :-

      Did you remember to make the first column something unique in your call to get_records? Duplicate value '1' found in column 'count'.

      • line 699 of /lib/dml/pgsql_native_moodle_database.php: call to debugging()
      • line 1256 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()
      • line 1331 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      • line 1502 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
      • line 123 of /blocks/online_users/block_online_users.php: call to moodle_database->count_records_sql()
      • line 280 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 4 of /theme/base/layout/frontpage.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 ? of unknownfile: call to core_renderer->header()
      • line 1229 of /lib/setuplib.php: call to call_user_func_array()
      • line 89 of /index.php: call to bootstrap_renderer->__call()
      • line 89 of /index.php: call to bootstrap_renderer->header()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Nov/11