Skip to content

Commit

Permalink
fix: DEBUG-VIEW comments are not output
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 7, 2024
1 parent 8744d96 commit 92a3405
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions system/View/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,19 @@ public function render(string $view, ?array $options = null, ?bool $saveData = n
$this->renderVars['view']
);

$afterFilters = service('filters')->getFiltersClass()['after'];
// Check if DebugToolbar is enabled.
$filters = Services::filters();
$requiredAfterFilters = $filters->getRequiredFilters('after')[0];
if (in_array('toolbar', $requiredAfterFilters, true)) {
$debugBarEnabled = true;
} else {
$afterFilters = $filters->getFiltersClass()['after'];
$debugBarEnabled = in_array(DebugToolbar::class, $afterFilters, true);
}

if (
($this->debug && (! isset($options['debug']) || $options['debug'] === true))
&& in_array(DebugToolbar::class, $afterFilters, true)
$this->debug && $debugBarEnabled
&& (! isset($options['debug']) || $options['debug'] === true)
) {
$toolbarCollectors = config(Toolbar::class)->collectors;

Expand Down

0 comments on commit 92a3405

Please sign in to comment.