Keep default configuration without setting $criticalQueryThreshold.
Make request with at least one DB query.
What's expected?
Since $criticalQueryThreshold is unset, no warning is shown on /debug/default/index nor at DB panel's title
What do you get instead?
/debug/default/index omits warning, but DB panel's title shows warning with message:
"Executed 9 database queries which took 6 ms.
Too many queries, allowed count is ."
Additional info
/vendor/yiisoft/yii2-debug/src/views/default/index.php makes check via isQueryCountCritical() method :
if ($dbPanel->isQueryCountCritical($data['sqlCount'])) {
$title .= ' Too many queries. Allowed count is ' . $dbPanel->criticalQueryThreshold;
$hasError = true;
}
But, /vendor/yiisoft/yii2-debug/src/views/default/panels/db/summary.php accesses $criticalQueryThreshold directly, without checking if it's set:
if ($queryCount >= $panel->criticalQueryThreshold) {
$title .= " Too many queries, allowed count is {$panel->criticalQueryThreshold}.";
$hasError = true;
}
It should be updated to:
if ($panel->isQueryCountCritical($queryCount)) {
$title .= " Too many queries, allowed count is {$panel->criticalQueryThreshold}.";
$hasError = true;
}
What steps will reproduce the problem?
Keep default configuration without setting
$criticalQueryThreshold
. Make request with at least one DB query.What's expected?
Since
$criticalQueryThreshold
is unset, no warning is shown on /debug/default/index nor at DB panel's titleWhat do you get instead?
/debug/default/index omits warning, but DB panel's title shows warning with message: "Executed 9 database queries which took 6 ms. Too many queries, allowed count is ."
Additional info
/vendor/yiisoft/yii2-debug/src/views/default/index.php makes check via
isQueryCountCritical()
method :But, /vendor/yiisoft/yii2-debug/src/views/default/panels/db/summary.php accesses
$criticalQueryThreshold
directly, without checking if it's set:It should be updated to:
to use same isset logic as listing page.