Browse Source

added checks in theme preprocessor for missing dc

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

13
theme/theme.inc

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

Loading…
Cancel
Save