Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-3396

hotpot use of get_users_by_capability will cause performance issues.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.11
    • Fix Version/s: None
    • Component/s: Module: HotPot
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      get_users_by_capability is a heavy query, and should really only be used once per page load if possible. It looks like the hotpot report.php file could potentially call it 4 times on one page load. - This would likely cause a timeout issue if the hotpot module was added to a site homepage for a site that has a large number of users.

      in fact - this call in function hotpot_print_report()

      $teachers = get_users_by_capability($modulecontext, 'mod/hotpot:viewreport', 'u.id,u.firstname,u.lastname', 'u.lastname');

      doesn't seem to be needed. and should be removed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xxxxxxx Gordon Bateson
                Reporter:
                danmarsden Dan Marsden
                Tester:
                Dan Marsden
                Participants:
                Component watchers:
                Gordon Bateson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: