Browse Source

Reordered invalid PID check to catch more invalidity cases

pull/689/head
Bryan J. Brown 8 years ago
parent
commit
db357e460a
  1. 9
      islandora.module

9
islandora.module

@ -1226,21 +1226,20 @@ function islandora_object_load($object_id) {
return $tuque->repository->getObject(urldecode($object_id)); return $tuque->repository->getObject(urldecode($object_id));
} }
catch (Exception $e) { catch (Exception $e) {
if ($e->getCode() == '404') { // Check to see if invalid PID was passed
return FALSE;
}
else {
module_load_include('inc', 'islandora', 'includes/utilities'); module_load_include('inc', 'islandora', 'includes/utilities');
if (!islandora_is_valid_pid($object_id)) { if (!islandora_is_valid_pid($object_id)) {
watchdog('islandora', 'Failed to load invalid PID: @pid', array('@pid' => $object_id), WATCHDOG_ERROR); watchdog('islandora', 'Failed to load invalid PID: @pid', array('@pid' => $object_id), WATCHDOG_ERROR);
return FALSE; return FALSE;
} }
elseif ($e->getCode() == '404') {
return FALSE;
}
else { else {
return NULL; return NULL;
} }
} }
} }
}
else { else {
IslandoraTuque::getError(); IslandoraTuque::getError();
} }

Loading…
Cancel
Save