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

Broken profiling links in footer

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Requirements

      1. To have some of the xhprof-supported extensions installed and enabled. You can find some previous steps in the testing instructions of MDL-70297.

      Steps

      1. Ensure that debug is set to developer level.
      2. Enable profiling ($CFG->profilingenabled = true;) in your site (you will need the xhprof extension installed and enabled).
      3. Enable under demand profiling ($CFG->profilingallowme = true;)
      4. Go to any page in the site and add &PROFILEME (or ?PROFILEME if the URL doesn't have parameters) at the end of the URL.
      5. Verify that in the footer a "This script has been profiled" link is displayed.
      6. Verify that the link points to a page where you can see the summary information of the just profiled page with information like (Run ID, URL, Date, Execution time....and more).
      Show
      Requirements To have some of the xhprof-supported extensions installed and enabled. You can find some previous steps in the testing instructions of MDL-70297 . Steps Ensure that debug is set to developer level. Enable profiling ( $CFG->profilingenabled = true; ) in your site (you will need the xhprof extension installed and enabled). Enable under demand profiling ( $CFG->profilingallowme = true; ) Go to any page in the site and add &PROFILEME (or ?PROFILEME if the URL doesn't have parameters) at the end of the URL. Verify that in the footer a "This script has been profiled" link is displayed. Verify that the link points to a page where you can see the summary information of the just profiled page with information like (Run ID, URL, Date, Execution time....and more).

      Discovered this by coincidence, because I saw some PHP warnings in logs:

      Undefined variable $SCRIPT in /lib/outputrenderers.php on line 888

      Tracing down the problem, this is a regression of MDL-71965, where a global statement was not moved to a new function created there. Pretty simple.

      To reproduce:

      • Enable profiling ($CFG->profilingenabled = true;) in your site (you will need the xhprof extension installed and enabled).
      • Enable under demand profiling ($CFG->profilingallowme = true;)
      • Go to any page in the site and add &PROFILEME at the end of the URL.
      • In the footer a "This script has been profiled" link will display.

      Expected:

      • The link points to a page where you can see the summary information of the just profiled page.

      Actual:

      • The link points to a page with the "Sorry, cannot find any profiling run for the '' URL" message.

        1. xhprof.jpg
          43 kB
          Sara Arjona (@sarjona)

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Mathew May Mathew May
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 40 minutes
                2h 40m

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