Skip to content

Commit

Permalink
Fix for "Pipe All" process to properly match records.
Browse files Browse the repository at this point in the history
  • Loading branch information
moorejr5 committed May 16, 2023
1 parent b59236f commit 48a9247
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CrossprojectpipingExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ function pipeToRecord($dst_rid) {
];
$data_repeatable_to_save = [];
$returnarray = $resultData = array();

// for every source project:
foreach ($this->projects['source'] as $p_index => $src_project) {
// get the destination match field name
Expand All @@ -1066,12 +1067,14 @@ function pipeToRecord($dst_rid) {
foreach ($field_data as $ieid => $formData) {
foreach ($formData as $formName => $instanceData) {
foreach ($instanceData as $iNum => $subData) {
if ($subData[$src_match_field] != $record_match_info[$dest_match_field]) continue;
$resultData = $this->processDataTransfer($resultData,$dst_rid,$src_project,$ieid,$subData,$src_match_field,$dest_match_field,$source_match_field_is_in_pipe_fields,$iNum);
}
}
}
}
else {
if ($field_data[$src_match_field] != $record_match_info[$dest_match_field]) continue;
$resultData = $this->processDataTransfer($resultData,$dst_rid,$src_project,$eid,$field_data,$src_match_field,$dest_match_field,$source_match_field_is_in_pipe_fields);
}
}
Expand All @@ -1082,6 +1085,7 @@ function pipeToRecord($dst_rid) {
$result = \REDCap::saveData('array', $resultData);
//return $result;
$returnarray['data-push'] = $result;
$returnarray['data-list'][$dst_rid] = $resultData;
}

return $returnarray;
Expand Down

0 comments on commit 48a9247

Please sign in to comment.