Merge pull request #18723 from SachinBahukhandi/console-fix-debug-cfg

If $cfg['DBG']['sql'] doesn't exist or is set to false, Debug SQL tab should be hidden

Fixes #18716
This commit is contained in:
Maurício Meneghini Fauth 2024-03-16 13:51:19 -03:00 committed by GitHub
commit 09dc7a5686
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -19,9 +19,11 @@
<span>{{ 'Bookmarks'|trans }}</span>
</div>
{% endif %}
<div class="button debug hide">
<span>{{ 'Debug SQL'|trans }}</span>
</div>
{% if debug %}
<div class="button debug hide">
<span>{{ 'Debug SQL'|trans }}</span>
</div>
{% endif %}
</div>
{# Console messages #}

View File

@ -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,
]);
}
}