Browse Source

Getting rid of datastream not found messages.

pull/120/head
jonathangreen 13 years ago
parent
commit
5499cfd659
  1. 8
      includes/datastream.inc

8
includes/datastream.inc

@ -19,6 +19,12 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
try { try {
$restConnection = new RestConnection($user); $restConnection = new RestConnection($user);
$fedora_object = new FedoraObject($object_id, $restConnection->repository); $fedora_object = new FedoraObject($object_id, $restConnection->repository);
// if the object exists but the datastream doesn't
if(!isset($fedora_object[$dsid])) {
return drupal_not_found();
}
header('Content-type: ' . $fedora_object[$dsid]->mimetype); header('Content-type: ' . $fedora_object[$dsid]->mimetype);
if($fedora_object[$dsid]->controlGroup == 'M' || $fedora_object[$dsid]->controlGroup == 'X') { if($fedora_object[$dsid]->controlGroup == 'M' || $fedora_object[$dsid]->controlGroup == 'X') {
header('Content-length: ' . $fedora_object[$dsid]->size); header('Content-length: ' . $fedora_object[$dsid]->size);
@ -31,7 +37,7 @@ function islandora_datastream_as_attachment($object_id, $dsid) {
print($fedora_object[$dsid]->content); print($fedora_object[$dsid]->content);
exit(); exit();
} catch (Exception $e) { } catch (Exception $e) {
return drupal_not_found();; return drupal_not_found();
} }
} }

Loading…
Cancel
Save