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/11 13:47:00 UTC

[jira] [Commented] (OFBIZ-13571) Mini-lang to Groovy regressions in QuoteServicesScript

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

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

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

Fixed: Mini-lang to Groovy regressions in QuoteServicesScript (OFBIZ-13571)

Fix several regressions and bugs introduced during the migration of Quote services from Mini-lang to Groovy:
- copyQuoteItem: preserve original quoteId when quoteIdTo is omitted, pass resolved target IDs when copying adjustments, and fix error label lookup to OrderErrorUiLabels.
- createQuoteFromCustRequest: guard against NPE when CustRequest does not exist, exclude REQ_TAKER role when copying parties to prevent duplicate role creation errors, and properly scope exprdCond.
- updateQuote: return an error if Quote is not found instead of throwing an NPE on quote.statusId, and properly scope quoteId.
- createQuoteItem: query Product strictly by productId instead of passing the entire parameters map.
- createQuoteNote: propagate the actual error from createNote and verify noteId presence before creating QuoteNote.
- autoUpdateQuotePrice: fix error label lookup to OrderErrorUiLabels.
- OrderErrorUiLabels.xml: define missing OrderQuoteDoesNotExists and OrderQuoteItemDoesNotExists labels.


> Mini-lang to Groovy regressions in QuoteServicesScript
> ------------------------------------------------------
>
>                 Key: OFBIZ-13571
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13571
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Upcoming Branch, 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>
> An audit of QuoteServicesScript.groovy against the original MiniLang implementation in QuoteServices.xml revealed several regressions and bugs introduced during the migration:
> 1. copyQuoteItem:
>    - When parameters.quoteIdTo is omitted (standard when copying an item within the same quote), input.quoteId is overwritten with null instead of preserving quoteItem.quoteId, causing createQuoteItem to fail.
>    - When copying quote adjustments, parameters.quoteIdTo and parameters.quoteItemSeqIdTo are passed directly. When target IDs are auto-generated, these are null, causing createQuoteAdjustment to fail.
>    - copyQuoteItem should return the target quoteId and quoteItemSeqId.
> 2. createQuoteFromCustRequest:
>    - Accesses custRequest.custRequestTypeId before verifying that custRequest exists, resulting in a NullPointerException when a non-existent custRequestId is passed.
>    - Unconditionally attempts to create quote roles for all CustRequestParty records. Since createQuote already assigns the REQ_TAKER role, this causes a duplicate primary key error on QuoteRole when a REQ_TAKER party is present.
>    - Variable exprdCond is assigned without a type declaration, leaking into the script binding.
> 3. updateQuote:
>    - Evaluates quote.statusId without checking if quote exists, throwing a NullPointerException if a non-existent quoteId is passed.
> 4. createQuoteItem:
>    - Passes the entire parameters map to from('Product').where(parameters) instead of scoping the condition to productId.
> 5. createQuoteNote:
>    - Swallows the underlying error returned by createNote with a generic message and does not verify noteId presence before attempting to persist QuoteNote.
> 6. Missing UI Labels:
>    - OrderQuoteDoesNotExists and OrderQuoteItemDoesNotExists are referenced in QuoteServicesScript.groovy but missing from OrderErrorUiLabels.xml.
>    - In copyQuoteItem and autoUpdateQuotePrice, the label lookup refers to OrderUiLabels instead of OrderErrorUiLabels.



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