From 1e7ae558b209cda2a9ee7cc0657c8ee1afb0f48f Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 21:40:56 -0300 Subject: [PATCH] Fixed some bugs for the submission of xml forms. --- fedora_repository.module | 20 ++++++++------------ formClass.inc | 1 + 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 4ce0d7d2..1a95be07 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -122,12 +122,10 @@ function fedora_repository_ingest_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); - if ($xml_form->isInitialized()) { - $doc = $form->submit($drupal_form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); - } + $doc = $xml_form->submit($form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); } else if ($form_state['clicked_button']['#id'] == 'edit-submit') { global $base_url; @@ -644,12 +642,10 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) { if ($form_state['storage']['xml']) { module_load_include('inc', 'xml_form_api', 'XMLForm'); $xml_form = new XMLForm($form_state); - if ($xml_form->isInitialized()) { - $doc = $form->submit($drupal_form, $form_state); - $document = $doc->document; - dom_document_pretty_print($document); - exit(); - } + $doc = $xml_form->submit($form, $form_state); + $document = $doc->document; + dom_document_pretty_print($document); + exit(); } else { module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); diff --git a/formClass.inc b/formClass.inc index 083deb7c..10921bf2 100644 --- a/formClass.inc +++ b/formClass.inc @@ -705,6 +705,7 @@ class formClass { $content_model = ContentModel::loadFromObject($pid); $form_names = islandora_content_model_get_form_names($content_model->pid); } + $form_state['storage']['xml'] = false; if (isset($form_state['storage']['step']) || (isset($form_names) && count($form_names) > 0)) { // Form Exists... $form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1;