diff --git a/islandora_basic_collection/includes/CollectionPolicy.inc b/islandora_basic_collection/includes/CollectionPolicy.inc index cbe261d1..3cbd2592 100644 --- a/islandora_basic_collection/includes/CollectionPolicy.inc +++ b/islandora_basic_collection/includes/CollectionPolicy.inc @@ -20,9 +20,9 @@ class CollectionPolicy { * @return CollectionPolicy * The parsed collection policy. */ - public function __construct($xmlStr) { + public function __construct($xml_string) { $this->xml = new DOMDocument(); - $this->xml->loadXML($xmlStr); + $this->xml->loadXML($xml_string); $this->name = 'Collection Policy'; } diff --git a/islandora_basic_collection/includes/child_collection.inc b/islandora_basic_collection/includes/child_collection.inc index ab289ed1..f696286a 100644 --- a/islandora_basic_collection/includes/child_collection.inc +++ b/islandora_basic_collection/includes/child_collection.inc @@ -17,7 +17,15 @@ function islandora_create_child_collection_form($form, &$form_state, $collection module_load_include('inc', 'islandora_basic_collection', 'includes/CollectionPolicy'); $policy_datastream = $collection_object->getDatastream(variable_get('Islandora_Collection_Policy_DSID', 'COLLECTION_POLICY')); + if (!$policy_datastream) { + $form['no_policy'] = array( + '#type' => 'item', + '#title' => t('No collection policy datastream found!'), + ); + return $form; + } $collection_policy = new CollectionPolicy($policy_datastream->content); + $current_content_models = $collection_policy->getContentModels(); $collection_content_model_exists = FALSE;