Skip to content

Commit

Permalink
Include profiling scripts initially, bug#3639
Browse files Browse the repository at this point in the history
  • Loading branch information
atul516 committed May 23, 2013
1 parent 01fb62b commit dbb0ed3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
17 changes: 16 additions & 1 deletion libraries/common.inc.php
Expand Up @@ -1049,12 +1049,27 @@
// the checkbox was unchecked
unset($_SESSION['profiling']);
}
/**
* Inclusion of profiling scripts is needed on various
* pages like sql, tbl_sql, db_sql, tbl_select
*/
$response = PMA_Response::getInstance();
if (isset($_SESSION['profiling'])) {
$header = $response->getHeader();
$scripts = $header->getScripts();
/* < IE 9 doesn't support canvas natively */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
$scripts->addFile('canvg/flashcanvas.js');
}
$scripts->addFile('jqplot/jquery.jqplot.js');
$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js');
$scripts->addFile('canvg/canvg.js');
}

/*
* There is no point in even attempting to process
* an ajax request if there is a token mismatch
*/
$response = PMA_Response::getInstance();
if ($response->isAjax() && $token_mismatch) {
$response->isSuccess(false);
$response->addJSON(
Expand Down
13 changes: 0 additions & 13 deletions sql.php
Expand Up @@ -68,19 +68,6 @@
$GLOBALS['printview'] = $_REQUEST['printview'];
}

if (isset($_SESSION['profiling'])) {
$response = PMA_Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
/* < IE 9 doesn't support canvas natively */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
$scripts->addFile('canvg/flashcanvas.js');
}
$scripts->addFile('jqplot/jquery.jqplot.js');
$scripts->addFile('jqplot/plugins/jqplot.pieRenderer.js');
$scripts->addFile('canvg/canvg.js');
}

if (!isset($_SESSION['is_multi_query'])) {
$_SESSION['is_multi_query'] = false;
}
Expand Down

2 comments on commit dbb0ed3

@lem9
Copy link
Contributor

@lem9 lem9 commented on dbb0ed3 May 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Atul,
This cannot be fixed in the QA_4_0 branch?

@atul516
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Marc,
Same fix worked for QA_4_0 too, done in c88762e

Please sign in to comment.