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/29 14:33:00 UTC

[jira] [Commented] (OFBIZ-13621) Six regressions in the minilang-to-Groovy conversion of ProductServicesScript.groovy, including a guaranteed crash and a permission-scope gap

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

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

Commit 9fe258fd6a55ad4974f5e10d156e940634797058 in ofbiz-framework's branch refs/heads/release24.09 from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=9fe258fd6a ]

Fixed: Six regressions in the minilang-to-Groovy conversion of ProductServicesScript.groovy (OFBIZ-13621)

- deleteProductGroupOrder() always threw: it called removeRelated('OrderItemGroupOrder'), a relation that doesn't exist on ProductGroupOrder, and removed the parent row before its children. Now removes OrderItemGroupOrder rows first, then the parent.
- checkProductRelatedPermission() dropped the product's category-membership date filter, since a second filterByDate() call replaced rather than added to the first. A limited-admin could retain permission via an expired category membership.
- forceIndexProductKeywords() and deleteProductKeywords() added .cache() to their Product lookup, not present in the original mini-lang.
- cancleOrderItemGroupOrder() treated a legitimate cancelQuantity of zero as unset due to Groovy's truthiness on BigDecimal.
- updateProductQuickAdminName() passed the wrong method-name string to its permission check, producing a misleading error message.


> Six regressions in the minilang-to-Groovy conversion of ProductServicesScript.groovy, including a guaranteed crash and a permission-scope gap
> ---------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13621
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13621
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product/catalog
>    Affects Versions: Upcoming Branch, 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Critical
>
> *1. {{deleteProductGroupOrder()}} always throws — CRITICAL*
> {{productGroupOrder.removeRelated('OrderItemGroupOrder')}} — no such relation exists on {{ProductGroupOrder}}'s entity model, so this throws every time. The parent is also removed before its children, which would violate the FK even if the relation name were fixed. Needs reordering plus a correct child-removal query.
> *2. {{checkProductRelatedPermission()}} drops a date filter — security-relevant*
> {{.filterByDate('roleFromDate', 'roleThruDate')}} replaces rather than adds to the default filter pair, so the product's own category-membership window is never checked — only the party's role-assignment window is. A limited-admin can retain edit/delete rights on a product whose category membership has expired. Fix: pass both pairs in one call.
> *3-4. Added {{.cache()}} not in the original mini-lang*
> {{forceIndexProductKeywords()}} and {{deleteProductKeywords()}}'s {{Product}} lookups now cache; the force-reindex method in particular can read stale data.
> *5. Groovy truthiness on {{cancelQuantity}}*
> {{orderItem.cancelQuantity ?: orderItem.quantity}} wrongly falls back when {{cancelQuantity}} is legitimately 0.
> *6. Wrong string in {{updateProductQuickAdminName()}}*
> Passes {{'updateQuickAdminName'}} instead of {{'updateProductQuickAdminName'}} — cosmetic, wrong text in a permission-denied message.



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