This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new ed406d0dd0 Fixed: CheckoutServices anonymous-checkout party
reattachment and createUpdatePerson new-party-id regressions (OFBIZ-13544)
ed406d0dd0 is described below
commit ed406d0dd0f345431dec2621acdc4093b3d73de5
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 f799ef1cc2..47977a538d 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 513fe57b18..d938a5e06d 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
}