From 7057c12b76a9de08f470940752c96ee59494ea78 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 22 Jan 2013 13:46:30 -0400 Subject: [PATCH 1/2] 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'); From cf19d4fffcf60ee6e9e21f648f7b5577083917d5 Mon Sep 17 00:00:00 2001 From: Alan Stanley Date: Tue, 22 Jan 2013 13:47:28 -0400 Subject: [PATCH 2/2] Added validity check --- fedora_repository.module | 1 + 1 file changed, 1 insertion(+) diff --git a/fedora_repository.module b/fedora_repository.module index 41ac102c..799e1e10 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -1839,6 +1839,7 @@ function islandora_guarantee_root_collection($pid) { } $item = new Fedora_Item($pid); if ($item->exists()) { + drupal_set_message(t('Fedora is not available')); return; } $item = Fedora_item::ingest_new_item($pid, 'A', 'Islandora Root Collection', 'admin');