From 2a66496d615ec2eb782711acd246e63514fe51a1 Mon Sep 17 00:00:00 2001 From: cbasguti Date: Tue, 27 Jun 2023 22:46:49 +0200 Subject: [PATCH] fix: Format query not working inside view modal Query formatting didn't work inside Create view modal, when table has 0 rows. Signed-off-by: cbasguti --- libraries/classes/Sql.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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]);