From 1b587c3f6a17f6e78230cabb7f99872e79771172 Mon Sep 17 00:00:00 2001
From: "s.pongratz" <s.pongratz@adito.de>
Date: Wed, 24 Nov 2021 11:19:23 +0100
Subject: [PATCH] BugfixLiquibaseMailbridge

---
 process/StandardObject_lib/process.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/process/StandardObject_lib/process.js b/process/StandardObject_lib/process.js
index fbc566801e..106239747a 100644
--- a/process/StandardObject_lib/process.js
+++ b/process/StandardObject_lib/process.js
@@ -5,6 +5,7 @@ import("Keyword_lib");
 import("KeywordRegistry_basic");
 import("Contact_lib");
 import("Communication_lib");
+import("Context_lib");
 
 function StandardObject (pObjectType, pObjectID, pScopeType, pScopeID) {
     if (!this._isValidType("object", pObjectType))
@@ -246,7 +247,7 @@ StandardObject.prototype._getCompanyStandardAddress = function (pOrganisationID)
  * 
  * @param {String} pObjectRowId The rowid of the communication to check.
  * @param {String} pMediumCategory Medium category to check.
- * @param {String} pObjectType=Contact (Optional) The type of the rowid
+ * @param {String} pObjectType=CurrentContextId (Optional) The type of the rowid
  * @return {Boolean} If the contact already has a standard addres with the given
  * medium category.
  */
@@ -258,7 +259,7 @@ StandardObject.prototype._hasStandardCommunicationByMedium = function (pObjectRo
         .leftJoin("AB_KEYWORD_ATTRIBUTERELATION", "AB_KEYWORD_ENTRY_ID = AB_KEYWORD_ENTRYID")
         .where("ISSTANDARD = 1")
         .and("COMMUNICATION.OBJECT_ROWID", pObjectRowId)
-        .and("COMMUNICATION.OBJECT_TYPE", (pObjectType ? pObjectType : CommUtil.defaultObjectType()))
+        .and("COMMUNICATION.OBJECT_TYPE", (pObjectType ? pObjectType : ContextUtils.getCurrentContextId()))
         .and("AB_KEYWORD_ENTRY.KEYID", CommUtil.getMediumIdsByCategory(pMediumCategory), SqlBuilder.IN())
         .arrayColumn()
         .indexOf(pMediumCategory) !== -1;
-- 
GitLab