diff --git a/system/src/Grav/Common/Page/Collection.php b/system/src/Grav/Common/Page/Collection.php index 59302b781..9cd237c04 100644 --- a/system/src/Grav/Common/Page/Collection.php +++ b/system/src/Grav/Common/Page/Collection.php @@ -361,12 +361,13 @@ class Collection extends Iterator { $routable = []; - foreach (array_keys($this->items) as $path => $slug) { + foreach ($this->items as $path => $slug) { $page = $this->pages->get($path); if ($page->routable()) { $routable[$path] = $slug; } } + $this->items = $routable; return $this; }