From 33c06067c14691750aa9a02267614294e6e617e0 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Mon, 14 Feb 2011 16:14:24 -0400 Subject: [PATCH] ISLANDORA-195 Breadcrumb breaks on top-level collection Test results for FALSE and not NULL after doing a preg match --- ObjectHelper.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 9b24f088..ea75d332 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -998,7 +998,8 @@ class ObjectHelper { */ function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); - + // Before executing the query, we hve a base case of accessing the top-level collection + global $base_url; $query_string = 'select $parentObject $title $content from <#ri> where ( $title and $parentObject $content @@ -1015,11 +1016,14 @@ class ObjectHelper { $result = preg_split('/[\r\n]+/',do_curl($url)); array_shift($result); // throw away first line $matches =str_getcsv(join("\n",$result)); - if ($matches !== NULL) { + if ($matches !== FALSE) { $parent = preg_replace('/^info:fedora\//','',$matches[0]); $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); if ($parent == variable_get('fedora_repository_pid', 'islandora:top')) { - $breadcrumbs[] = l(t('Home'), ''); // l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); + $breadcrumbs[] = l(t('Home'), $base_url); + + } elseif ($level > 0) { $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); }