Fixed: Service calls of "createPartyContactMech" now include the needed contactMechTypeId (OFBIZ-12175) (#292)

This was broken by OFBIZ-8358 where, as well explained at OFBIZ-12175, "createPartyContactMech Service has been changed to expect an OUT contactMechTypeId paramter and the call on this end has not been modified."
This commit is contained in:
bjugl
2021-04-08 11:05:38 +02:00
committed by GitHub
parent 7fd9d05f7e
commit 983f04dfd6
@@ -2595,6 +2595,7 @@ public class PartyServices {
if (currentContactMechPurposeTypeId != null && ("TELECOM_NUMBER".equals(currentContactMechTypeId)
|| "POSTAL_ADDRESS".equals(currentContactMechTypeId) || "EMAIL_ADDRESS".equals(currentContactMechTypeId))) {
partyContactMechPurpose.put("contactMechPurposeTypeId", currentContactMechPurposeTypeId);
partyContactMechPurpose.put("contactMechTypeId", currentContactMechTypeId);
partyContactMechPurposeChanged = (lastContactMechPurposeTypeId == null
|| !lastContactMechPurposeTypeId.equals(currentContactMechPurposeTypeId)) && !telecomNumberChanged
&& !postalAddressChanged && !emailAddressChanged;
@@ -2617,7 +2618,7 @@ public class PartyServices {
currentContactMechPurposeTypeId = "GENERAL_LOCATION";
}
Map<String, Object> serviceResult = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId,
"contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId,
"contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId,
"userLogin", userLogin));
if (ServiceUtil.isError(serviceResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
@@ -2634,7 +2635,7 @@ public class PartyServices {
currentContactMechPurposeTypeId = "PHONE_WORK";
}
Map<String, Object> resultMap = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId,
"contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId,
"contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId,
"userLogin", userLogin));
if (ServiceUtil.isError(resultMap)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
@@ -2651,7 +2652,7 @@ public class PartyServices {
currentContactMechPurposeTypeId = "PRIMARY_EMAIL";
}
Map<String, Object> resultMap = dispatcher.runSync("createPartyContactMech", UtilMisc.toMap("partyId", newPartyId,
"contactMechId", newContactMechId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin",
"contactMechId", newContactMechId, "contactMechTypeId", currentContactMechTypeId, "contactMechPurposeTypeId", currentContactMechPurposeTypeId, "userLogin",
userLogin));
if (ServiceUtil.isError(resultMap)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));