From 33f7e40156e0d76c050830f4de4ca0b1400bf21a Mon Sep 17 00:00:00 2001
From: Nigel Banks <nigel.g.banks@gmail.com>
Date: Thu, 8 Sep 2011 19:32:39 +0100
Subject: [PATCH] ISLANDORA-317: fixed by checking the stuff.

---
 fedora_repository.module | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fedora_repository.module b/fedora_repository.module
index 41632fb1..5372868f 100644
--- a/fedora_repository.module
+++ b/fedora_repository.module
@@ -751,6 +751,10 @@ function fedora_repository_get_items($pid = NULL, $dsId = NULL, $collection = NU
     drupal_set_message(t('The Fedora repository server is currently unavailable. Please contact the site administrator.'), 'warning', FALSE);
     return '';
   }
+  
+  if ($pid == NULL) {
+    $pid = variable_get('fedora_repository_pid', 'islandora:top');
+  }
 
   $item = new fedora_item($pid);
   if (!$item->exists()) {