From 34bf05d51a4ceda2616790df1b1d28a21742f947 Mon Sep 17 00:00:00 2001
From: Tobias Feldmann <t.feldmann@adito.de>
Date: Sun, 28 Jul 2019 16:06:56 +0200
Subject: [PATCH] Bugfix CampaignParticipant_entity

---
 .../participantsdbrecordcontainer/onDBInsert.js               | 3 ++-
 process/Campaign_lib/process.js                               | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js
index b0c1baba02..bc3712278f 100644
--- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js
+++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/onDBInsert.js
@@ -6,5 +6,6 @@ var campaignId = rowdata["CAMPAIGNPARTICIPANT.CAMPAIGN_ID"];
 var campaignStepId = rowdata["CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID"];
 var contactId = rowdata["CAMPAIGNPARTICIPANT.CONTACT_ID"];
 var campaignParticipantId = vars.get("$local.uid");
+var previousCampaignstepId = "";
 
-CampaignUtils.createLogEntry(campaignId, campaignStepId, contactId, campaignParticipantId);
\ No newline at end of file
+CampaignUtils.createLogEntry(campaignId, campaignStepId, contactId, campaignParticipantId, previousCampaignstepId);
\ No newline at end of file
diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js
index 4f6bd8f475..0cce037c48 100644
--- a/process/Campaign_lib/process.js
+++ b/process/Campaign_lib/process.js
@@ -132,11 +132,11 @@ CampaignUtils.getCampaignStatusByCampaignId = function(pCampaignId)
     return KeywordUtils.getViewValue(campaignState, statusId);
 }
 
-CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId)
+CampaignUtils.createLogEntry = function(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, pPreviousCampaignstepId)
 {
     let colsCampaignParticipantLog = CampaignUtils.getParticipantLogInsertColumnNames();
     
-    let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"));
+    let valsCampaignParticipantLog = new Array(pCampaignId, pCampaignStepId, pContactId, pCampaignParticipantId, vars.get("$sys.user"), vars.get("$sys.date"), pPreviousCampaignstepId);
     
     let rows = db.insertData("CAMPAIGNPARTICIPANTLOG", colsCampaignParticipantLog, null, valsCampaignParticipantLog);
     return (rows == 1);
-- 
GitLab