diff --git a/libraries/classes/Sql.php b/libraries/classes/Sql.php index 1f1330100d..a3883fc5e9 100644 --- a/libraries/classes/Sql.php +++ b/libraries/classes/Sql.php @@ -995,6 +995,9 @@ class Sql $response = ResponseRenderer::getInstance(); $response->addJSON($extraData ?? []); + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('sql.js'); if (! $statementInfo->isSelect || isset($extraData['error'])) { return $queryMessage; @@ -1024,10 +1027,6 @@ class Sql $profilingChart = ''; if ($profilingResults !== []) { - $header = $response->getHeader(); - $scripts = $header->getScripts(); - $scripts->addFile('sql.js'); - $profiling = $this->getDetailedProfilingStats($profilingResults); if ($profiling !== []) { $profilingChart = $this->template->render('sql/profiling_chart', ['profiling' => $profiling]);