From 735f34056c6c0f66899ab8536426d5e606ad509b Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Thu, 21 Nov 2019 14:11:04 +0100
Subject: [PATCH] fix SqlBuilder Usages

---
 .../KeywordEntry_entity/recordcontainers/db/conditionProcess.js | 2 +-
 process/Campaign_lib/process.js                                 | 2 +-
 process/Offer_lib/process.js                                    | 2 +-
 process/Order_lib/process.js                                    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js b/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js
index acdde11cb5..a7b1817d14 100644
--- a/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js
+++ b/entity/KeywordEntry_entity/recordcontainers/db/conditionProcess.js
@@ -24,4 +24,4 @@ if (vars.getString("$param.WhitelistIds_param"))
 }
 
 //TODO: use a preparedCondition (.build instead of .toString) when available #1030812 #1034026
-result.string(cond.tostring());
+result.string(cond.toString());
diff --git a/process/Campaign_lib/process.js b/process/Campaign_lib/process.js
index 598b0411b2..e8e13eb65b 100644
--- a/process/Campaign_lib/process.js
+++ b/process/Campaign_lib/process.js
@@ -446,7 +446,7 @@ CampaignUtils.copyCampaignSteps = function(pSourceCampaignId, pTargetCampaignId)
 {
     var InputMapping = {
         "CAMPAIGNSTEP": {
-            condition: newWhere("CAMPAIGN.CAMPAIGN_ID", pSourceCampaignId).orderBy("SORTING").toString(),
+            condition: newWhereIfSet("CAMPAIGN.CAMPAIGN_ID", pSourceCampaignId).orderBy("SORTING").toString("1=2", true),
             ValueMapping: {
                 "CAMPAIGN_ID" : pTargetCampaignId
             }
diff --git a/process/Offer_lib/process.js b/process/Offer_lib/process.js
index 8940287ff6..67df25ece2 100644
--- a/process/Offer_lib/process.js
+++ b/process/Offer_lib/process.js
@@ -331,7 +331,7 @@ OfferUtils.copyOfferItems = function (pSourceOfferId, pTargetOfferId)
 {
     var InputMapping = {
         "OFFERITEM": {
-            condition: newWhere("OFFERITEM.OFFER_ID", pSourceOfferId).orderBy("ITEMSORT").toString(),
+            condition: newWhereIfSet("OFFERITEM.OFFER_ID", pSourceOfferId).orderBy("ITEMSORT").toString("1=2", true),
             ValueMapping: {
                 "OFFER_ID" : pTargetOfferId
             }
diff --git a/process/Order_lib/process.js b/process/Order_lib/process.js
index e75ed7697e..a2aa75f231 100644
--- a/process/Order_lib/process.js
+++ b/process/Order_lib/process.js
@@ -145,7 +145,7 @@ OrderUtils.copyOfferItemsToOrder = function (pOfferId, pOrderId)
                 "INFO" : "INFO",
                 "VAT" : "VAT"
             },
-            condition: newWhere("OFFERITEM.OFFER_ID", pSourceOfferId).orderBy("ITEMSORT").toString(),
+            condition: newWhereIfSet("OFFERITEM.OFFER_ID", pSourceOfferId).orderBy("ITEMSORT").toString("1=2", true),
             ValueMapping: {
                 "OFFER_ID" : pOrderId
             }
-- 
GitLab