svn commit: r1177189 - /ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

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

svn commit: r1177189 - /ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

sascharodekamp
Author: sascharodekamp
Date: Thu Sep 29 07:33:04 2011
New Revision: 1177189

URL: http://svn.apache.org/viewvc?rev=1177189&view=rev
Log:
FIX: Create New Customer fails if done after initial/aborted anonymous checkout (https://issues.apache.org/jira/browse/OFBIZ-765). The fix checks if there is already an anonymous user login for the current user available and remove it before creating a new one.

Modified:
    ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

Modified: ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=1177189&r1=1177188&r2=1177189&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml Thu Sep 29 07:33:04 2011
@@ -862,6 +862,26 @@ under the License.
 
     <!-- One page checkout process  -->
     <simple-method method-name="createUpdateUserLogin" short-description="Create and update a user login" login-required="false">
+        <!-- Check if for this user still an anonymus user login exists and remove it -->
+        <session-to-field field="user" session-name="userLogin"/>
+        <session-to-field field="cart" session-name="shoppingCart"/>
+
+        <if>
+            <condition>
+                    <and>
+                        <if-compare operator="equals" value="anonymous" field="cart.userLogin.userLoginId" />
+                        <if-compare operator="equals" value="anonymous" field="user.userLoginId" />
+                        <if-compare operator="equals" value="anonymous" field="userLogin.userLoginId" />
+                    </and>
+            </condition>
+            <then>
+                <clear-field field="userLogin"/>
+                <call-object-method method-name="removeAttribute" obj-field="session">
+                    <string value="userLogin" />
+                </call-object-method>
+            </then>
+        </if>
+
         <if-empty field="parameters.partyId">
             <request-to-field request-name="partyId" field="parameters.partyId"/>
         </if-empty>