Browse Source

added checks in theme preprocessor for missing dc

pull/272/head
Jason MacWilliams 12 years ago
parent
commit
cd81a80bfc
  1. 9
      theme/theme.inc

9
theme/theme.inc

@ -108,10 +108,17 @@ function islandora_preprocess_islandora_default(&$variables) {
}
$variables['datastreams'] = $datastreams;
try {
$dc = $islandora_object['DC']->content;
//pp,jm added missing value checks for fcrepo4
$datastream = $islandora_object['DC'];
if (isset($datastream)) {
$dc = $datastream->content;
$dc_object = DublinCore::importFromXMLString($dc);
if (isset($dc_object)) {
$dc_array = $dc_object->asArray();
}
}
}
catch (Exception $e) {
drupal_set_message(t('Error retrieving object %s %t', array('%s' => $islandora_object->id, '%t' => $e->getMessage())), 'error', FALSE);
}

Loading…
Cancel
Save