From 951de45cc525cf9ae438887520331a9f80ebd576 Mon Sep 17 00:00:00 2001 From: davidcallizaya Date: Tue, 10 Oct 2017 11:38:28 -0400 Subject: [PATCH] HOR-3906 Do not upgrade usr_uid to guest when the process is updated. It will be modified from any other place (webentry UI dialog, endpoint) --- .../engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php | 6 ++++-- .../src/ProcessMaker/Project/Adapter/BpmnWorkflow.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php index 2b588f6a6..e26705140 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/WebEntryEvent.php @@ -796,7 +796,7 @@ class WebEntryEvent * @return array Return data of the WebEntry-Event updated * @throws Exception */ - public function update($webEntryEventUid, $userUidUpdater, array $arrayData) + public function update($webEntryEventUid, $userUidUpdater, array $arrayData, $updateUser = true) { try { //Verify data @@ -826,7 +826,9 @@ class WebEntryEvent //Define if the webEntry need to use the guest user $weUserUid = isset($arrayData["USR_UID"]) ? $arrayData["USR_UID"] : ''; $weAuthentication = isset($arrayData["WE_AUTHENTICATION"]) ? $arrayData["WE_AUTHENTICATION"] : ''; - $arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid); + if ($updateUser) { + $arrayData["USR_UID"] = $this->getWebEntryUser($weAuthentication, $weUserUid); + } //Verify data with the required fields $this->throwExceptionIfDataIsInvalid($webEntryEventUid, $arrayWebEntryEventData["PRJ_UID"], $arrayData); diff --git a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php index fb79e87eb..6083ac8ad 100644 --- a/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php +++ b/workflow/engine/src/ProcessMaker/Project/Adapter/BpmnWorkflow.php @@ -2086,7 +2086,8 @@ class BpmnWorkflow extends Project\Bpmn $arrayResult = $webEntryEvent->update( $arrayWebEntryEventData['WEE_UID'], $bpmnProject->getPrjAuthor(), - (!is_null($arrayData))? $arrayData : $arrayWebEntryEventData + (!is_null($arrayData))? $arrayData : $arrayWebEntryEventData, + false ); } }