From 07beafc679049108fed5f4261ce2cc1a67a72c8e Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Fri, 22 Jul 2016 17:21:02 +0200 Subject: [PATCH] If no parent is set and I call a siblings collection, return a new collection Fix for a plugins combination issue detailed in https://github.com/getgrav/grav-plugin-sitemap/issues/22 --- system/src/Grav/Common/Page/Page.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index b3679bbdb..abb421078 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -2337,6 +2337,9 @@ class Page $results = $collection->addPage($this->parent()); break; case 'siblings': + if (!$this->parent()) { + return new Collection(); + } $results = $this->parent()->children()->remove($this->path()); break; case 'descendants':