From b6add106e651ef3debd705a1a84b3d6cec26e09b Mon Sep 17 00:00:00 2001 From: Skymirrh Date: Sat, 12 Sep 2020 00:15:59 +0200 Subject: [PATCH] Fix collection retrieval `children()` only retrieves direct children, as per the code: https://github.com/getgrav/grav/blob/1.6.27/system/src/Grav/Common/Page/Page.php#L2422 `collection()` is the proper retrieval method: https://github.com/getgrav/grav/blob/1.6.27/system/src/Grav/Common/Page/Page.php#L2675 This can be confirmed by looking at what's used for collection operations (e.g. `isFirst()` or `isLast()`): https://github.com/getgrav/grav/blob/1.6.27/system/src/Grav/Common/Page/Page.php#L2439 --- archives.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archives.php b/archives.php index 49f1ae4..e5a8d6a 100644 --- a/archives.php +++ b/archives.php @@ -224,9 +224,9 @@ protected function getArchives($filters, $operator, $order) } } if ($new_approach) { - $collection = $page->children(); + $collection = $page->collection('content', false); } elseif ($page_filter) { - $collection = $pages->find($page_filter)->children(); + $collection = $pages->find($page_filter)->collection('content', false); } else { $collection = new Collection(); $collection->append($taxonomy_map->findTaxonomy($find_taxonomy, $operator)->toArray());