Remove caching from Pages count (regular)

This commit is contained in:
Matias Griese
2019-08-27 10:57:33 +03:00
parent 5ae1de9b4f
commit ec44621b68

View File

@@ -910,17 +910,8 @@ class Admin
public function pagesCount()
{
if (!$this->pages_count) {
/** @var Cache $cache */
$cache = $this->grav['cache'];
$count = $cache->fetch('admin-pages-count');
if (false === $count) {
$pages = static::enablePages();
$count = count($pages->all());
$cache->save('admin-pages-count', $count);
}
$this->pages_count = $count;
$pages = static::enablePages();
$this->pages_count = count($pages->all());
}
return $this->pages_count;