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));
}
catch (Exception $e) {
if ($e->getCode() == '404') {
return FALSE;
}
else {
// Check to see if invalid PID was passed
module_load_include('inc', 'islandora', 'includes/utilities');
if (!islandora_is_valid_pid($object_id)) {
watchdog('islandora', 'Failed to load invalid PID: @pid', array('@pid' => $object_id), WATCHDOG_ERROR);
return FALSE;
}
elseif ($e->getCode() == '404') {
return FALSE;
}
else {
return NULL;
}
}
}
}
else {
IslandoraTuque::getError();
}

Loading…
Cancel
Save