You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/08 07:24:00 UTC

[jira] [Commented] (OFBIZ-13565) createUpdateCustomerAndShippingAddress never refreshes partyId for the shipping-address step, crashing anonymous checkout

    [ https://issues.apache.org/jira/browse/OFBIZ-13565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112548#comment-18112548 ] 

ASF subversion and git services commented on OFBIZ-13565:
---------------------------------------------------------

Commit 981dd598942dd06fdf1fbe8e4e2f1f8805e0adae in ofbiz-framework's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=981dd59894 ]

Fixed: createUpdateCustomerAndShippingAddress leaves shipToAddressCtx.partyId stale after a new party is created (OFBIZ-13565)

createUpdatePersonCtx and shipToAddressCtx both alias parameters, but after createUpdatePerson returns the newly-created party's ID, only the local partyId variable was updated - parameters.partyId (and thus shipToAddressCtx.partyId) stayed null. createUpdateShippingAddress then read that stale null partyId, and createPartyPostalAddress failed inserting PartyContactMech with a NULL PARTY_ID. Refreshing parameters.partyId right after createUpdatePerson returns keeps shipToAddressCtx consistent with the rest of the method, which already used the corrected local variable.


> createUpdateCustomerAndShippingAddress never refreshes partyId for the shipping-address step, crashing anonymous checkout
> -------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13565
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13565
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Upcoming Branch, 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>
> 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)