Skip to content

Commit

Permalink
Fixed enabling PHP Debug Bar causes fatal error in Gantry [#2634]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Aug 19, 2019
1 parent 5f1639d commit 8cbc2a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Added experimental support for `Flex Pages` (**Flex Objects** plugin required)
1. [](#bugfix)
* Fixed `$page->summary()` always striping HTML tags if the summary was set by `$page->setSummary()`
* Grav 1.7: Fixed enabling PHP Debug Bar causes fatal error in Gantry [#2634](https://github.com/getgrav/grav/issues/2634)

# v1.7.0-beta.5
## 08/11/2019
Expand Down
10 changes: 5 additions & 5 deletions system/src/Grav/Common/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public function getCaller($limit = 2)
*/
public function addCollector($collector)
{
if ($this->debugbar) {
if ($this->debugbar && !$this->debugbar->hasCollector($collector->getName())) {
$this->debugbar->addCollector($collector);
}

Expand All @@ -449,15 +449,15 @@ public function addCollector($collector)
/**
* Returns a data collector
*
* @param DataCollectorInterface $collector
* @param string $name
*
* @return DataCollectorInterface
* @throws \DebugBar\DebugBarException
*/
public function getCollector($collector)
public function getCollector($name)
{
if ($this->debugbar) {
return $this->debugbar->getCollector($collector);
if ($this->debugbar && $this->debugbar->hasCollector($name)) {
return $this->debugbar->getCollector($name);
}

return null;
Expand Down

0 comments on commit 8cbc2a2

Please sign in to comment.