Merged in bugfix/PMC-748 (pull request #6871)

PMC-748

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2019-05-02 19:11:00 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 15 additions and 15 deletions

View File

@@ -3541,19 +3541,19 @@ class Cases
*/
if ($oPMScript->executedOn() === $oPMScript::AFTER_ROUTING) {
//Get the variables changed with the trigger
$fieldsTrigger = arrayDiffRecursive($appDataAfterTrigger, $fieldsCase);
$fieldsTrigger = getDiffBetweenModifiedVariables($appDataAfterTrigger, $fieldsCase);
$collection = collect($fieldsCase);
$merged = $collection->merge($fieldsTrigger);
//Merge the appData with variables changed
$fieldsCase = $merged->all();
//We will be load the last appData because:
//Other thread execution can be changed the variables
$appUid = !empty($fieldsCase['APPLICATION']) ? $fieldsCase['APPLICATION'] : '';
//Save the fields changed in the trigger
if (!$varInAfterRouting && !empty($fieldsTrigger)) {
$varInAfterRouting = true;
}
//Merge the appData with variables changed
$fieldsCase = array_merge($fieldsCase, $fieldsTrigger);
} else {
$fieldsCase = $appDataAfterTrigger;
}