Fixed enabling PHP Debug Bar causes fatal error in Gantry [#2634]

This commit is contained in:
Matias Griese
2019-08-19 10:04:59 +03:00
parent 5f1639dc63
commit 8cbc2a27cd
2 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -439,7 +439,7 @@ class Debugger
*/
public function addCollector($collector)
{
if ($this->debugbar) {
if ($this->debugbar && !$this->debugbar->hasCollector($collector->getName())) {
$this->debugbar->addCollector($collector);
}
@@ -449,15 +449,15 @@ class Debugger
/**
* 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;