mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-11-03 20:05:53 +01:00 
			
		
		
		
	Remove caching from Pages count (regular)
This commit is contained in:
		@@ -910,17 +910,8 @@ class Admin
 | 
				
			|||||||
    public function pagesCount()
 | 
					    public function pagesCount()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if (!$this->pages_count) {
 | 
					        if (!$this->pages_count) {
 | 
				
			||||||
            /** @var Cache $cache */
 | 
					 | 
				
			||||||
            $cache = $this->grav['cache'];
 | 
					 | 
				
			||||||
            $count = $cache->fetch('admin-pages-count');
 | 
					 | 
				
			||||||
            if (false === $count) {
 | 
					 | 
				
			||||||
            $pages = static::enablePages();
 | 
					            $pages = static::enablePages();
 | 
				
			||||||
 | 
					            $this->pages_count = count($pages->all());
 | 
				
			||||||
                $count = count($pages->all());
 | 
					 | 
				
			||||||
                $cache->save('admin-pages-count', $count);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            $this->pages_count = $count;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this->pages_count;
 | 
					        return $this->pages_count;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user