From 3dd37810c199fd401166cf6c7384a8977a928288 Mon Sep 17 00:00:00 2001 From: rwincewicz Date: Fri, 1 Jun 2012 10:31:22 -0300 Subject: [PATCH 1/2] Fixed issue with child collections not being created --- islandora_basic_collection/includes/child_collection.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/islandora_basic_collection/includes/child_collection.inc b/islandora_basic_collection/includes/child_collection.inc index f696286a..e1204a41 100644 --- a/islandora_basic_collection/includes/child_collection.inc +++ b/islandora_basic_collection/includes/child_collection.inc @@ -136,7 +136,7 @@ function islandora_create_child_collection_form_submit($form, &$form_state) { $new_collection_pid = $form_state['values']['new_collection_pid']; $this_collection_pid = $form_state['values']['current']; if(empty($new_collection_pid)) { - $collection_namespace = substr($this_collection_pid, 0, strpos($this_collection_pid, ":")); + $new_collection_pid = substr($this_collection_pid, 0, strpos($this_collection_pid, ":")); } $new_collection_label = $form_state['values']['collection_name']; $namespace = $form_state['values']['collection_namespace']; @@ -185,5 +185,5 @@ function islandora_create_child_collection_form_submit($form, &$form_state) { $fedora_object->ingestDatastream($policy_datastream); $new_fedora_object = islandora_ingest_add_object($fedora_object); - drupal_goto('/islandora/object/' . $new_collection_pid); + drupal_goto('/islandora/object/' . $new_fedora_object->id); } \ No newline at end of file From c3b3ee15305a8f0ace2b08240d330adb867a16d1 Mon Sep 17 00:00:00 2001 From: rwincewicz Date: Fri, 1 Jun 2012 10:50:07 -0300 Subject: [PATCH 2/2] Fixed restConnection line in manage collection policies --- islandora_basic_collection/includes/manage_policies.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/islandora_basic_collection/includes/manage_policies.inc b/islandora_basic_collection/includes/manage_policies.inc index 9207edb4..291c2cc8 100644 --- a/islandora_basic_collection/includes/manage_policies.inc +++ b/islandora_basic_collection/includes/manage_policies.inc @@ -137,6 +137,7 @@ function islandora_manage_policies_form_validate($form, &$form_state) { * @param array $form_state */ function islandora_manage_policies_form_submit($form, &$form_state) { + module_load_include('module', 'islandora', 'islandora'); $collection_pid = $form_state['values']['parent_collection']; $collection_object = islandora_object_load($collection_pid); @@ -166,7 +167,8 @@ function islandora_manage_policies_form_submit($form, &$form_state) { $cp_namespace = $form_state['values']['new_cp_namespace']; $cp_content_model = $form_state['values']['content_model_to_add']; - $content_model_object = new FedoraObject($cp_content_model, $rest_connection->repository); +// $content_model_object = new FedoraObject($cp_content_model, $rest_connection->repository); + $content_model_object = islandora_object_load($cp_content_model); $content_model_datastream = $content_model_object->getDatastream(variable_get('Islandora_Content_Model_DSID', 'ISLANDORACM')); $content_models_element = $collection_policy_xml->getElementsByTagName('content_models');