Skip to content

Commit

Permalink
Fix for #1227 issue - Admin JSON calls throwing errors with debugger on
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Dec 26, 2016
1 parent 8aee946 commit 55a9356
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v1.1.12
## 12/26/2016

1. [](#bugfix)
* Fixed issue with JSON calls throwing errors due to debugger enabled [#1227](https://github.com/getgrav/grav/issues/1227)

# v1.1.11
## 12/22/2016

Expand Down
8 changes: 8 additions & 0 deletions system/src/Grav/Common/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ public function enabled($state = null)
public function addAssets()
{
if ($this->enabled()) {

// Only add assets if Page is HTML
$page = $this->grav['page'];
if ($page->templateFormat() != 'html') {
$this->enabled = false;
return;
}

/** @var Assets $assets */
$assets = $this->grav['assets'];

Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ public function templateFormat($var = null)
}

if (empty($this->template_format)) {
$this->template_format = Grav::instance()['uri']->extension();
$this->template_format = Grav::instance()['uri']->extension('html');
}

return $this->template_format;
Expand Down

0 comments on commit 55a9356

Please sign in to comment.