Browse Source

Notifiy the user when the repository is down.

pull/203/head
Nigel Banks 12 years ago
parent
commit
6b181c1f48
  1. 3
      includes/utilities.inc
  2. 4
      islandora.module

3
includes/utilities.inc

@ -83,7 +83,8 @@ function islandora_is_valid_dsid($dsid) {
return drupal_strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid)); return drupal_strlen(trim($dsid)) <= 64 && preg_match('/^[a-zA-Z0-9\_\-\.]+$/', trim($dsid));
} }
/* Helper function to describe a Fedora repository. /**
* Helper function to describe a Fedora repository.
* *
* Can be used to check if Fedora is available. * Can be used to check if Fedora is available.
* *

4
islandora.module

@ -460,6 +460,10 @@ function islandora_object_load($object_id) {
} }
$object = islandora_get_object_by_id($object_id); // Either NULL or FALSE. $object = islandora_get_object_by_id($object_id); // Either NULL or FALSE.
if (!isset($object)) { if (!isset($object)) {
module_load_include('inc', 'islandora', 'includes/utilities');
if (islandora_describe_repository() === FALSE) {
drupal_set_message(t('The repository is not availible please contact the administrator.'), 'error');
}
$load_failed = TRUE; $load_failed = TRUE;
} }
return $object; return $object;

Loading…
Cancel
Save