[ofbiz-framework] branch release17.12 updated: Fixed: Unable to continue to Step 3 in One Page Checkout (OFBIZ-11318)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release17.12 updated: Fixed: Unable to continue to Step 3 in One Page Checkout (OFBIZ-11318)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release17.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release17.12 by this push:
     new 2f479d5  Fixed: Unable to continue to Step 3 in One Page Checkout (OFBIZ-11318)
2f479d5 is described below

commit 2f479d56ce7b715961ba2fa1b67362b13351ebcb
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Feb 7 13:48:03 2020 +0100

    Fixed: Unable to continue to Step 3 in One Page Checkout
    (OFBIZ-11318)
   
    The following error is returned when trying to continue to Step3 when checking
    out using One Page Checkout.
   
    Could not create new purpose, a purpose with that type already exists.:
    [GenericEntity:PartyContactWithPurpose][contactFromDate,2020-01-05 19:48:18.29
    (java.sql.Timestamp)][contactMechId,10020(java.lang.String)]
    [contactMechPurposeTypeId,SHIPPING_LOCATION(java.lang.String)]
    [partyId,admin(java.lang.String)][purposeFromDate,2020-01-05 19:48:18.332
    (java.sql.Timestamp)
   
    It does not happen with DemoCustomer but at least with admin user
   
    It was caused by OFBIZ-10588. I checked for similar issues and found that, in
    unlike in createUpdateBillingAddress, in createUpdateShippingAddress and
    createUpdateCreditCard partyId was used without a prior setting from
    parameters.partyId
   
    Thanks: James Young for proposing a solution. I rather fixed otherwise this and
    another similar case in createUpdateCreditCard
---
 applications/order/minilang/order/OrderServices.xml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/applications/order/minilang/order/OrderServices.xml b/applications/order/minilang/order/OrderServices.xml
index 81c8456..a444c8e 100644
--- a/applications/order/minilang/order/OrderServices.xml
+++ b/applications/order/minilang/order/OrderServices.xml
@@ -856,7 +856,8 @@ under the License.
         <call-map-processor xml-resource="component://order/minilang/customer/CheckoutMapProcs.xml"
             processor-name="shipToAddress" in-map-name="parameters" out-map-name="shipToAddressCtx"/>
         <check-errors/>
-        <set field="shipToAddressCtx.partyId" from-field="parameters.partyId"/>
+        <set field="partyId" from-field="parameters.partyId"/>
+        <set field="shipToAddressCtx.partyId" from-field="partyId"/>
 
         <if-empty field="shipToAddressCtx.contactMechId">
             <set field="shipToAddressCtx.contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
@@ -1094,7 +1095,8 @@ under the License.
     </simple-method>
     <simple-method method-name="createUpdateCreditCard" short-description="create and update credit card">
         <set-service-fields service-name="createCreditCard" map="parameters" to-map="creditCardContext"/>
-        <set field="creditCardContext.partyId" from-field="parameters.partyId"/>
+        <set field="partyId" from-field="parameters.partyId"/>
+        <set field="creditCardContext.partyId" from-field="partyId"/>
         <set field="creditCardContext.contactMechId" from-field="parameters.contactMechId"/>
         <if-empty field="parameters.paymentMethodId">
             <!-- call create Credit Card -->