From 3993bd0dff8ed1fb61daa5db20b09897e649ead1 Mon Sep 17 00:00:00 2001 From: Bumme Date: Tue, 20 Aug 2013 11:40:11 +0200 Subject: [PATCH] Changed the pullResource function to prevent a 500 error. Added a check for the current resource and the breadcrumbs config "pathThruUnPub". This lets you to see a unpublished page and not get a 500 error. --- .../breadcrumbs/model/breadcrumbs/breadcrumbs.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php b/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php index 8ec1b92..3be7359 100644 --- a/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php +++ b/core/components/breadcrumbs/model/breadcrumbs/breadcrumbs.class.php @@ -246,7 +246,7 @@ public function pullResource($resourceId){ $wa = array( 'id' => $resourceId, ); - if (!$this->config['pathThruUnPub']) { + if (!$this->config['pathThruUnPub'] && $resourceId != $this->modx->resource->get('id')) { $wa['published'] = true; $wa['deleted'] = false; } @@ -327,4 +327,4 @@ public function getChunk($name,array $properties = array()) { } return $o; } -} \ No newline at end of file +}