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/19 07:56:00 UTC
[jira] [Created] (OFBIZ-13600) Three regressions in the minilang-to-Groovy conversion of PaymentServices.groovy
Mridul Pathak created OFBIZ-13600:
-------------------------------------
Summary: Three regressions in the minilang-to-Groovy conversion of PaymentServices.groovy
Key: OFBIZ-13600
URL: https://issues.apache.org/jira/browse/OFBIZ-13600
Project: OFBiz
Issue Type: Bug
Components: accounting
Affects Versions: 24.09.07, Upcoming Branch
Reporter: Mridul Pathak
Assignee: Mridul Pathak
h3. removePaymentApplication
{{run service: 'setInvoiceStatus', with: [invoiceId: paymentApplication.invoiceId, statustId: 'INVOICE_READY']}} misspells {{statusId}} as {{statustId}}. The map key is silently dropped when the service context is validated, so removing a payment application from a paid invoice never actually reverts the invoice back to {{INVOICE_READY}} — it stays stuck showing as paid. The original minilang set {{invoiceStatusMap.statusId}} correctly.
h3. createPaymentAndPaymentGroupForInvoices
When {{parameters.invoiceIds}} is empty (or resolves to no valid party groupings), the {{result}} variable is never assigned inside the per-party {{.each{}}} loop and stays null. The subsequent {{result.paymentGroupId}} check then throws a NullPointerException. The original minilang's equivalent field access on the same "nothing happened" case degraded gracefully instead of crashing. Note: this is a different, still-unfixed null-dereference in this method, distinct from the {{finAccount.statusId}} guard already fixed under OFBIZ-13596.
h3. createPaymentFromOrder
When an {{OrderPaymentPreference}} with a payment already exists for the order, the method returns {{failure(...)}} instead of a plain success. The original minilang's equivalent path was a bare {{<return/>}} — an intentional no-op success, not an error, since this is a normal, expected early-exit case (e.g. an order approved a second time). {{failure()}} responses aren't caught by {{ServiceUtil.isError()}}, so this can produce spurious FAIL-level results for what should be silently treated as nothing to do.
Needs fixing: Fix the {{statustId}} typo; null-guard {{result}} before dereferencing {{paymentGroupId}} (or return the same error() cleanly); and change the "payment already exists" branch to return {{success()}} instead of {{failure(...)}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)