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."
diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
index 6aad675..460a3bd 100644
--- a/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
+++ b/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyServices.java
@@ -2595,6 +2595,7 @@
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 @@
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 @@
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 @@
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));