From 1df56b1f87ee00925ca647f25bc4827dc92f21ab Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Tue, 21 Jun 2011 19:24:37 -0300 Subject: [PATCH] Edit form now populates correctly, --- formClass.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/formClass.inc b/formClass.inc index 128724f4..bcabc6bf 100644 --- a/formClass.inc +++ b/formClass.inc @@ -735,7 +735,18 @@ class formClass { $definition = FormBuilder::GetFormDefinition($form_name); $form = XMLFormDefinition::GetDrupalForm($definition); $properties = XMLFormDefinition::GetFormProperties($definition); - $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema']); + // XML + $dsid = islandora_content_model_get_dsid($content_model->pid, $form_name); + $params = array('pid' => "$pid", 'dsID' => "$dsid", 'asOfDateTime' => ""); + try { + $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params)); + } catch (Exception $e) { + return array(); // Empty form? + } + $xml = $object->dissemination->stream; + $xml = trim($xml); + // XML + $document = new XMLDocument($properties['document']['root'], $properties['document']['namespaces'], $properties['document']['schema'], $xml); $xml_form->initialize($form, $document); } return $xml_form->toArray();