mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-14 09:16:05 +01:00
Fix #1141 referencing DI element when not initialized
This commit is contained in:
15
admin.php
15
admin.php
@@ -523,18 +523,17 @@ class AdminPlugin extends Plugin
|
||||
*/
|
||||
public function onShutdown()
|
||||
{
|
||||
// Just so we know that we're in this debug mode
|
||||
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')) {
|
||||
|
||||
// Only track non-admin
|
||||
if (!$this->active) {
|
||||
$this->popularity->trackHit();
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->grav['admin']->shouldLoadAdditionalFilesInBackground()) {
|
||||
$this->grav['admin']->loadAdditionalFilesInBackground();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user