From 7057c12b76a9de08f470940752c96ee59494ea78 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 22 Jan 2013 13:46:30 -0400 Subject: [PATCH] Added validity check --- fedora_repository.module | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index b1d5d688..41ac102c 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1831,10 +1831,14 @@ function islandora_fedora_settings_form_submit($form, &$form_state) { drupal_rebuild_theme_registry(); } -function islandora_guarantee_root_collection($pid){ +function islandora_guarantee_root_collection($pid) { + module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); module_load_include('inc', 'fedora_repository', 'api/fedora_item'); + if(!fedora_available ()){ + return; + } $item = new Fedora_Item($pid); - if($item->exists()){ + if ($item->exists()) { return; } $item = Fedora_item::ingest_new_item($pid, 'A', 'Islandora Root Collection', 'admin');