Repository: catchpoint/WebPageTest (language: php)

Issue:
Vitals Link not using median run
## Description
The Vitals page isn't choosing the median run, but instead looks to be using the first run meaning we get a difference in the vitals we report on the summary page, versus the vitals page.

This only happens when we click the vitals link the dropdown, not when we click the link by the metrics themselves.

To reproduce, go here: https://www.webpagetest.org/result/220127_AiDcQS_8462a22a72406255db2870ccaee607d7/
The click the Vitals link the dropdown navigation and notice how the vitals metrics are different than the summary page.


Discussion / hints:

Fix patch:
diff --git a/www/header.inc b/www/header.inc
index f909851807..8887e81699 100644
--- a/www/header.inc
+++ b/www/header.inc
@@ -404,7 +404,8 @@ if( !strcasecmp('Test Result', $tab) && (!isset($nosubheader) || !@$nosubheader)
         if( !isset($run) )
             $run = $gradeRun;
         $useFriendlyUrls = !isset($_REQUEST['end']) && FRIENDLY_URLS;
-        $menuUrlGenerator = UrlGenerator::create($useFriendlyUrls, "", $id, $run, !empty($cached));
+
+        $menuUrlGenerator = UrlGenerator::create($useFriendlyUrls, "", $id, $gradeRun, !empty($cached));
         $endParams = isset($_REQUEST['end']) ? ("end=" . $_REQUEST['end']) : "";
 
         $tabs = array( 'Performance Summary' => $menuUrlGenerator->resultSummary($endParams));
@@ -416,7 +417,6 @@ if( !strcasecmp('Test Result', $tab) && (!isset($nosubheader) || !@$nosubheader)
         $gradedRunResults = $testResults->getRunResult($gradeRun, !empty($cached));
 
 
-
         if ($gradedRunResults->hasWebVitals())
             $tabs['Web Vitals'] = $menuUrlGenerator->resultPagePHP("vitals", $endParams);
 


Test patch: