From 9082cd5b177ea4a9cbfdf7ff6966b21d9da55568 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 19 Mar 2021 09:59:15 +0200 Subject: [PATCH] Fixed the list of pages not showing up in admin [#3280] --- CHANGELOG.md | 1 + system/src/Grav/Common/Flex/Types/Pages/PageIndex.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be29a12cd..fc0122183 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Fixed method `$pages->find()` should never redirect [#3266](https://github.com/getgrav/grav/pull/3266) * Fixed `Page::activeChild()` throwing an error [#3276](https://github.com/getgrav/grav/issues/3276) * Fixed `Flex Page` CRUD ACL when creating a new page (needs Flex Objects plugin update) [grav-plugin-flex-objects#115](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/115) + * Fixed the list of pages not showing up in admin [#3280](https://github.com/getgrav/grav/issues/3280) # v1.7.8 ## 03/17/2021 diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php index c5b7ce964..d53d7f888 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php @@ -522,12 +522,13 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface $tmp = $child->children()->getIndex(); $child_count = $tmp->count(); $count = $filters ? $tmp->filterBy($filters, true)->count() : null; + $route = $child->getRoute(); $payload = [ 'item-key' => basename($child->rawRoute() ?? $child->getKey()), 'icon' => $icon, 'title' => htmlspecialchars($child->menu()), 'route' => [ - 'display' => $child->getRoute()->toString(false) ?: '/', + 'display' => ($route ? ($route->toString(false) ?: '/') : null) ?? '', 'raw' => $child->rawRoute(), ], 'modified' => $this->jsDate($child->modified()),