From 4d86d238852e7c58573a4aeac1a9f86284791d8b Mon Sep 17 00:00:00 2001 From: Sachin Bahukhandi Date: Wed, 20 Sep 2023 23:47:41 +0530 Subject: [PATCH] Added fix for hiding debug SQL on debug false Signed-off-by: Sachin Bahukhandi --- resources/templates/console/display.twig | 8 +++++--- src/Console.php | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/templates/console/display.twig b/resources/templates/console/display.twig index 1a64277253..7f3540d40c 100644 --- a/resources/templates/console/display.twig +++ b/resources/templates/console/display.twig @@ -19,9 +19,11 @@ {{ 'Bookmarks'|trans }} {% endif %} -
- {{ 'Debug SQL'|trans }} -
+ {% if debug %} +
+ {{ 'Debug SQL'|trans }} +
+ {% endif %} {# Console messages #} diff --git a/src/Console.php b/src/Console.php index d6b853f98c..8f735f5f33 100644 --- a/src/Console.php +++ b/src/Console.php @@ -111,11 +111,13 @@ class Console $bookmarkFeature = $this->relation->getRelationParameters()->bookmarkFeature; $sqlHistory = $this->relation->getHistory($this->config->selectedServer['user']); $bookmarkContent = $this->getBookmarkContent(); + $debug = isset($this->config->settings['DBG']) && $this->config->settings['DBG']['sql']; return $this->template->render('console/display', [ 'has_bookmark_feature' => $bookmarkFeature !== null, 'sql_history' => $sqlHistory, 'bookmark_content' => $bookmarkContent, + 'debug' => $debug, ]); } }