Skip to content

Commit

Permalink
ENH Ensure deprecation notices are collected
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Mar 9, 2023
1 parent d346a87 commit e0dd767
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions code/DebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
use LeKoala\DebugBar\Collector\SilverStripeCollector;
use SilverStripe\Config\Collections\DeltaConfigCollection;
use SilverStripe\Config\Collections\CachedConfigCollection;
use SilverStripe\Dev\Deprecation;

/**
* A simple helper
Expand Down Expand Up @@ -402,6 +403,13 @@ public static function renderDebugBar()
$initialize = false;
}

// Normally deprecation notices are output in a shutdown function, which runs well after debugbar has rendered.
// This ensures the deprecation notices which have been noted up to this point are logged out and collected by
// the MonologCollector.
if (method_exists(Deprecation::class, 'outputNotices')) {
Deprecation::outputNotices();
}

$script = self::$renderer->render($initialize);
return $script;
}
Expand Down

0 comments on commit e0dd767

Please sign in to comment.