From 8beee5a4499b191559077fada628609e6504c392 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Thu, 8 Sep 2016 15:28:34 +0800 Subject: [PATCH] MDL-55921 profiling: Adding missing vars --- lib/xhprof/xhprof_moodle.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/xhprof/xhprof_moodle.php b/lib/xhprof/xhprof_moodle.php index 293ffacaad1..c930d4ff0e0 100644 --- a/lib/xhprof/xhprof_moodle.php +++ b/lib/xhprof/xhprof_moodle.php @@ -613,6 +613,13 @@ function profiling_import_runs($file, $commentprefix = '') { function profiling_export_generate(array $runids, $tmpdir) { global $CFG, $DB; + if (empty($CFG->release) || empty($CFG->version)) { + // Some scripts may not have included version.php. + include($CFG->dirroot.'/version.php'); + $CFG->release = $release; + $CFG->version = $version; + } + // Calculate the header information to be sent to moodle_profiling_runs.xml. $release = $CFG->release; $version = $CFG->version; -- 2.36.1