Fixed regression: Do not require Flex Objects plugin [grav#2653]

This commit is contained in:
Matias Griese
2019-08-30 09:40:14 +03:00
parent 4ca5d1699a
commit 0e23631038
2 changed files with 7 additions and 1 deletions

View File

@@ -1151,7 +1151,7 @@ class Admin
public function latestPages($count = 10)
{
/** @var Flex $flex */
$flex = $this->grav['flex_objects'];
$flex = $this->grav['flex_objects'] ?? null;
$directory = $flex ? $flex->getDirectory('grav-pages') : null;
if ($directory) {
return $directory->getIndex()->sort(['timestamp' => 'DESC'])->slice(0, $count);