Fixed admin cache to detect moved and deleted pages

This commit is contained in:
Matias Griese
2019-04-25 16:15:33 +03:00
parent c38e8a6b81
commit f02400ad13
2 changed files with 8 additions and 3 deletions

View File

@@ -168,8 +168,11 @@ class AdminPlugin extends Plugin
$this->active = true;
// Set cache based on admin_cache option
if (method_exists($this->grav['cache'], 'setEnabled')) {
$this->grav['cache']->setEnabled($this->config->get('plugins.admin.cache_enabled'));
$this->grav['cache']->setEnabled($this->config->get('plugins.admin.cache_enabled'));
$pages = $this->grav['pages'];
if (method_exists($pages, 'setCheckMethod')) {
// Force file hash checks to fix caching on moved and deleted pages.
$pages->setCheckMethod('hash');
}
}
}