Browse Source

Fixed some bugs for the submission of xml forms.

pull/3/merge
Nigel Banks 14 years ago
parent
commit
1e7ae558b2
  1. 8
      fedora_repository.module
  2. 1
      formClass.inc

8
fedora_repository.module

@ -122,13 +122,11 @@ function fedora_repository_ingest_form_submit($form, &$form_state) {
if ($form_state['storage']['xml']) { if ($form_state['storage']['xml']) {
module_load_include('inc', 'xml_form_api', 'XMLForm'); module_load_include('inc', 'xml_form_api', 'XMLForm');
$xml_form = new XMLForm($form_state); $xml_form = new XMLForm($form_state);
if ($xml_form->isInitialized()) { $doc = $xml_form->submit($form, $form_state);
$doc = $form->submit($drupal_form, $form_state);
$document = $doc->document; $document = $doc->document;
dom_document_pretty_print($document); dom_document_pretty_print($document);
exit(); exit();
} }
}
else if ($form_state['clicked_button']['#id'] == 'edit-submit') { else if ($form_state['clicked_button']['#id'] == 'edit-submit') {
global $base_url; global $base_url;
module_load_include('inc', 'fedora_repository', 'CollectionClass'); module_load_include('inc', 'fedora_repository', 'CollectionClass');
@ -644,13 +642,11 @@ function fedora_repository_edit_qdc_form_submit($form, &$form_state) {
if ($form_state['storage']['xml']) { if ($form_state['storage']['xml']) {
module_load_include('inc', 'xml_form_api', 'XMLForm'); module_load_include('inc', 'xml_form_api', 'XMLForm');
$xml_form = new XMLForm($form_state); $xml_form = new XMLForm($form_state);
if ($xml_form->isInitialized()) { $doc = $xml_form->submit($form, $form_state);
$doc = $form->submit($drupal_form, $form_state);
$document = $doc->document; $document = $doc->document;
dom_document_pretty_print($document); dom_document_pretty_print($document);
exit(); exit();
} }
}
else { else {
module_load_include('inc', 'fedora_repository', 'ConnectionHelper'); module_load_include('inc', 'fedora_repository', 'ConnectionHelper');
global $base_url; global $base_url;

1
formClass.inc

@ -705,6 +705,7 @@ class formClass {
$content_model = ContentModel::loadFromObject($pid); $content_model = ContentModel::loadFromObject($pid);
$form_names = islandora_content_model_get_form_names($content_model->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)) { if (isset($form_state['storage']['step']) || (isset($form_names) && count($form_names) > 0)) {
// Form Exists... // Form Exists...
$form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1; $form_state['storage']['step'] = isset($form_state['storage']['step']) ? $form_state['storage']['step'] : 1;

Loading…
Cancel
Save