From 97eddc5c8fad94f3d10f7fe8a17f375df489ad01 Mon Sep 17 00:00:00 2001 From: jennylee Date: Thu, 12 Jun 2014 15:44:09 -0400 Subject: [PATCH] BUG-15116 InputFile is lost when importing a process. When an already created process is imported with the 'Create a completely new process..' option, the inputs asociated in the dynaforms are not the input created for this new process, this new (copy) process still has associated the input of the original process (same UID), this because the uid of the new input is never replaced in the new process's dynaform xml file. So it was created a new field in the data object (the data that has all the information about the new process) where is all the old inputs uid and the new ones. Then using this object this old uids are replaced with the new inputs uids. --- workflow/engine/classes/class.processes.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/workflow/engine/classes/class.processes.php b/workflow/engine/classes/class.processes.php index cfa95c771..3a45404be 100755 --- a/workflow/engine/classes/class.processes.php +++ b/workflow/engine/classes/class.processes.php @@ -1564,6 +1564,7 @@ class Processes foreach ($oData->inputs as $key => $val) { $newGuid = $this->getUnusedInputGUID(); $map[$val['INP_DOC_UID']] = $newGuid; + $oData->inputFiles[$oData->inputs[$key]['INP_DOC_UID']] = $newGuid; $oData->inputs[$key]['INP_DOC_UID'] = $newGuid; } foreach ($oData->steps as $key => $val) { @@ -3146,6 +3147,12 @@ class Processes $XmlContent = str_replace( $oData->process['PRO_UID_OLD'], $oData->process['PRO_UID'], $XmlContent ); $XmlContent = str_replace( $XmlGuid, $newXmlGuid, $XmlContent ); + foreach($oData->inputFiles as $input => $valInput){ + $oldInput = $input; + $newInput = $oData->inputFiles[$oldInput]; + $XmlContent = str_replace( $oldInput, $newInput, $XmlContent ); + } + //foreach if (isset( $oData->gridFiles )) { if (is_array( $oData->gridFiles )) {