You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/09/08 06:10:00 UTC

[jira] [Created] (OFBIZ-13565) {{createUpdateCustomerAndShippingAddress}} never refreshes {{partyId}} for the shipping-address step after creating a new party, so first-time/anonymous checkout crashes.

Mridul Pathak created OFBIZ-13565:
-------------------------------------

             Summary: {{createUpdateCustomerAndShippingAddress}} never refreshes {{partyId}} for the shipping-address step after creating a new party, so first-time/anonymous checkout crashes.
                 Key: OFBIZ-13565
                 URL: https://issues.apache.org/jira/browse/OFBIZ-13565
             Project: OFBiz
          Issue Type: Bug
          Components: order
    Affects Versions: 24.09.07, Upcoming Branch
            Reporter: Mridul Pathak
            Assignee: Mridul Pathak


h3. Summary
{{createUpdateCustomerAndShippingAddress}} never refreshes {{partyId}} for the shipping-address step after creating a new party, so first-time/anonymous checkout crashes.

h3. Details
In CheckoutServices.groovy, {{createUpdatePersonCtx}} and {{shipToAddressCtx}} both alias {{parameters}}. After {{createUpdatePerson}} returns the new party's ID, only the local {{partyId}} variable is updated — {{parameters.partyId}} (and thus {{shipToAddressCtx.partyId}}) stays null. {{createUpdateShippingAddress}} then reads that stale null partyId, and {{createPartyPostalAddress}} fails.

h3. Reachability
Hit via plugins/ecommerce's one-page checkout (guest submits shipping form before any partyId exists). Reproduced live:
{noformat}
Exception thrown while creating the "newValue" GenericValue: org.apache.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:PartyContactMech][contactMechId,10000]...
SQL Exception while executing the following: INSERT INTO OFBIZ.PARTY_CONTACT_MECH (PARTY_ID, CONTACT_MECH_ID, FROM_DATE, THRU_DATE, ROLE_TYPE_ID, ...) VALUES (?, ?, ...) 
(NULL not allowed for column "PARTY_ID"; SQL statement: ... [23502-240])
{noformat}

h3. Note
OFBIZ-13544 (already merged upstream) happens to mask this bug's crash via an incidental userLogin-based fallback chain in a downstream minilang service — the underlying staleness is still present and unfixed, it just isn't currently throwing on its own after that merge. Worth fixing on its own rather than relying on that fallback.

h3. Suggested fix
After {{partyId = serviceResultCUP.partyId}}, add:
{code:groovy}
parameters.partyId = partyId
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)