Skip to content

Commit

Permalink
Fix #1141 referencing DI element when not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed Jun 21, 2017
1 parent 5bf721c commit 09f4d2b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,18 +523,17 @@ public function onTwigSiteVariables()
*/
public function onShutdown()
{
// Just so we know that we're in this debug mode
if ($this->config->get('plugins.admin.popularity.enabled')) {

// Only track non-admin
if (!$this->active) {
if ($this->active) {
//only activate when Admin is active
if ($this->shouldLoadAdditionalFilesInBackground()) {
$this->loadAdditionalFilesInBackground();
}
} else {
//if popularity is enabled, track non-admin hits
if ($this->config->get('plugins.admin.popularity.enabled')) {
$this->popularity->trackHit();
}
}

if ($this->grav['admin']->shouldLoadAdditionalFilesInBackground()) {
$this->grav['admin']->loadAdditionalFilesInBackground();
}
}

/**
Expand Down

0 comments on commit 09f4d2b

Please sign in to comment.