This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 2b14756f3e Fixed: CheckoutServices anonymous-checkout party 
reattachment and createUpdatePerson new-party-id regressions (OFBIZ-13544)
2b14756f3e is described below

commit 2b14756f3e2402cbe1f3259d2bf8abbc8e789128
Author: Mridul Pathak <[email protected]>
AuthorDate: Mon Sep 7 22:35:44 2026 +0530

    Fixed: CheckoutServices anonymous-checkout party reattachment and 
createUpdatePerson new-party-id regressions (OFBIZ-13544)
    
    - createUpdateCustomerAndShippingAddress's anonymous-user check is 
corrected from the misspelled 'anonymos' to 'anonymous', so a first-time guest 
checkout's shopping-cart userLogin is actually attached to the newly created 
party, rather than the branch silently never running.
    - createUpdatePerson now captures the newly-generated partyId from 
createPerson's result when creating a brand-new person, instead of always 
returning the (often empty) partyId it was originally called with. This was 
discovered while verifying the fix above: it's the only production caller of 
createUpdatePerson, and without this fix a genuine first-time anonymous 
checkout would crash at the very next step (ensurePartyRole) with a "Required 
Field Missing: Party Id" error, so both fixes [...]
---
 .../main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy | 2 +-
 .../groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy   | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
index eb69276ced..0eda688c53 100644
--- 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
+++ 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/CheckoutServices.groovy
@@ -60,7 +60,7 @@ Map createUpdateCustomerAndShippingAddress() {
 
     Map partyRoleCtx = [partyId: partyId, roleTypeId: 'CUSTOMER']
     if (userLogin) {
-        if (userLogin.userLoginId == 'anonymos') {
+        if (userLogin.userLoginId == 'anonymous') {
             userLogin.partyId = partyId
         }
         partyRoleCtx.userLogin = userLogin
diff --git 
a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
index 2c17a6ec07..93aaa03366 100644
--- 
a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
+++ 
b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
@@ -693,7 +693,10 @@ Map createUpdatePerson() {
        .where(partyId: partyId)
        .queryOne()
     String serviceName = (party ? 'update' : 'create') + 'Person'
-    run service: serviceName, with: personContext
+    Map serviceResult = run service: serviceName, with: personContext
+    if (!party) {
+        partyId = serviceResult.partyId
+    }
     resultMap.partyId = partyId
     return resultMap
 }

Reply via email to