Fixed: Passes required parameter contactMechTypeId while calling createPartyContactMech form copyPartyContactMechs service. Also pass same parameter in
testCreatePartyContactMech test case service. .
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1769645 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/party/minilang/test/PartyTests.xml b/applications/party/minilang/test/PartyTests.xml
index 4587f9d..7fe2268 100644
--- a/applications/party/minilang/test/PartyTests.xml
+++ b/applications/party/minilang/test/PartyTests.xml
@@ -541,6 +541,7 @@
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <set field="serviceCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
<call-service service-name="createPartyContactMech" in-map-name="serviceCtx"/>
<entity-and entity-name="PartyContactMech" list="partyContactMechList">
<field-map field-name="contactMechId" value="TestContactMech3"/>
diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java
index 68349ee..1169362 100644
--- a/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java
+++ b/applications/party/src/main/java/org/apache/ofbiz/party/contact/ContactMechServices.java
@@ -1016,7 +1016,7 @@
// create a new party contact mech for the partyIdTo
Map<String, Object> serviceResults = dispatcher.runSync("createPartyContactMech", UtilMisc.<String, Object>toMap("partyId", partyIdTo, "userLogin", userLogin,
- "contactMechId", contactMechId, "fromDate", UtilDateTime.nowTimestamp(),
+ "contactMechId", contactMechId, "contactMechTypeId", contactMech.getString("contactMechTypeId"), "fromDate", UtilDateTime.nowTimestamp(),
"allowSolicitation", partyContactMech.getString("allowSolicitation"), "extension", partyContactMech.getString("extension")));
if (ServiceUtil.isError(serviceResults)) {
return serviceResults;