diff --git a/ObjectHelper.inc b/ObjectHelper.inc index 62956809..c6a2ad1e 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); } diff --git a/tests/fedora_repository.test b/tests/fedora_repository.test index 3eb6226e..58cc887b 100644 --- a/tests/fedora_repository.test +++ b/tests/fedora_repository.test @@ -71,7 +71,8 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->drupalPost('fedora/ingestObject/islandora:top/Islandora%20Top-Level%20Collection', $ingest_form, 'Next'); // Required fields are file location, dc:title and dc:description $ingest_form_step_2 = array(); - $ingest_form_step_2['dc:title'] = $this->randomName(32); + $ingest_title = $this->randomName(32); + $ingest_form_step_2['dc:title'] = $ingest_title; $ingest_form_step_2['dc:description'] = $this->randomName(256); $ingest_form_step_2['files[ingest-file-location]'] = realpath(drupal_get_path('module', 'fedora_repository') . '/collection_policies/PDF-COLLECTION POLICY.xml'); $this->drupalPost(NULL, $ingest_form_step_2, 'Ingest'); @@ -79,6 +80,11 @@ class FedoraRepositoryTestCase extends DrupalWebTestCase { $this->assertPattern('/Item .* created successfully./', "Verified item created."); $pid = $this->getIngestedPid(); + $this->drupalGet("fedora/repository/$pid"); + $this->assertLink('Home'); + $this->assertLink('Digital Repository'); + $this->assertLink($ingest_title); + $pid_list[] = $pid; $this->pass('Now attempting to ingest a PDF into the new collection.'); // Now try ingesting a PDF