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.
This commit is contained in:
@@ -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 )) {
|
||||
|
||||
Reference in New Issue
Block a user