From e9dcac1e3813f31d5ae25b59452ca773494edf5b Mon Sep 17 00:00:00 2001 From: Andre Loreth <a.loreth@adito.de> Date: Fri, 2 Aug 2019 15:03:16 +0200 Subject: [PATCH] Contact: Do not return preset value for address if possible standard address is the private address default id --- .../Contact_entity/entityfields/address_id/valueProcess.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/entity/Contact_entity/entityfields/address_id/valueProcess.js b/entity/Contact_entity/entityfields/address_id/valueProcess.js index 75bc8b7662..a1fd89ea38 100644 --- a/entity/Contact_entity/entityfields/address_id/valueProcess.js +++ b/entity/Contact_entity/entityfields/address_id/valueProcess.js @@ -8,6 +8,9 @@ if (vars.get("$this.value") === null || vars.get("$this.value") === "" || vars.g .onPersonValueChange(vars.get("$field.ORGANISATION_ID")); // If a possible standard addrss was found it should get applied to the field. - if (possibleStandardAddressID !== null) + // The secondary condition is specifically for a new "private" person, because + // it has placeholder address with the id "0<35 whitespaces>" (whitspaces due + // to char36 and uuid format). + if (possibleStandardAddressID !== null && possibleStandardAddressID.trim() !== "0") result.string(possibleStandardAddressID); -} \ No newline at end of file +} -- GitLab