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

Check manager incorrectly instantiates plugin supplied performance checks

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_310_STABLE, MOODLE_311_STABLE
    • MDL-72924-fix-component-initialisation-for-performance-checks
    • Hide

      1) Update an existing status check, to the type of performance located here: /admin/tool/task/lib.php which is demonstrated in the diff below.

      (This changes part of the function name from status to performance)

      -function tool_task_status_checks() : array {
      +function tool_task_performance_checks() : array {

      2) Purge the caches

      3) Go to /report/performance/index.php and confirm you do not see any errors

      4) Confirm you do see the 'Cron running' check in the table (it's status doesn't matter).

       

      Show
      1)  Update an existing status check, to the type of performance located here: /admin/tool/task/lib.php which is demonstrated in the diff below. (This changes part of the function name from status to performance) -function tool_task_status_checks() : array { +function tool_task_performance_checks() : array { 2) Purge the caches 3) Go to /report/performance/index.php and confirm you do not see any errors 4) Confirm you do see the 'Cron running' check in the table (it's status doesn't matter).  

      Attempting to define a third party performance check in a plugin leads to a coding error when attempting to view the Performance check report.

       

      Exception - Cannot access protected property tool_xxx\check\enabled::$component

      Stack trace:

      • line 82 of /lib/classes/check/manager.php: Error thrown
      • line 56 of /lib/classes/check/manager.php: call to core\check\manager::get_performance_checks()
      • line 72 of /lib/classes/check/table.php: call to core\check\manager::get_checks()
      • line 35 of /report/performance/index.php: call to core\check\table->__construct()

       

      The manager attempts to directly set $check->component, whereas it is correctly accessed using the set_component() method for status and security checks

        1. MDL-72924_master.png
          MDL-72924_master.png
          148 kB
        2. MDL-72924_v310.png
          MDL-72924_v310.png
          130 kB
        3. MDL-72924_v311.png
          MDL-72924_v311.png
          130 kB

            kevinpham Kevin Pham
            peterburnett Peter Burnett
            Brendan Heywood Brendan Heywood
            Shamim Rezaie Shamim Rezaie
            Angelia Dela Cruz Angelia Dela Cruz
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m

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