From 688ec17cbab0b16e73b25d4a217344f83eec4d5f Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 28 Aug 2015 11:38:52 -0600 Subject: [PATCH] some fixes for no siblings --- system/src/Grav/Common/Page/Page.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index ed961594e..3339e9acc 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -1657,7 +1657,10 @@ class Page public function isFirst() { $collection = $this->parent()->collection('content', false); - return $collection->isFirst($this->path()); + if ($collection instanceof Collection) { + return $collection->isFirst($this->path()); + } + return true; } /** @@ -1668,7 +1671,10 @@ class Page public function isLast() { $collection = $this->parent()->collection('content', false); - return $collection->isLast($this->path()); + if ($collection instanceof Collection) { + return $collection->isLast($this->path()); + } + return true; } /** @@ -1700,7 +1706,10 @@ class Page public function adjacentSibling($direction = 1) { $collection = $this->parent()->collection('content', false); - return $collection->adjacentSibling($this->path(), $direction); + if ($collection instanceof Collection) { + return $collection->adjacentSibling($this->path(), $direction); + } + return false; } /**