This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7088506348 Fixed: Regressions in ShoppingListServicesScript.groovy
introduced by the mini-lang conversion (OFBIZ-13662)
7088506348 is described below
commit 708850634832064c87604352a9a61226b56186be
Author: Mridul Pathak <[email protected]>
AuthorDate: Fri Oct 9 11:56:39 2026 +0530
Fixed: Regressions in ShoppingListServicesScript.groovy introduced by the
mini-lang conversion (OFBIZ-13662)
The Groovy conversion of ShoppingListServices.xml changed the behaviour of
two services. Restore the mini-lang behaviour:
- addSuggestionsToShoppingList: for a variant product, link the complements
of the virtual product (productId of the variant ProductAssoc) instead of
re-linking the complements of the variant itself
- createShoppingListItem: treat a missing quantity as zero when adding to
an existing shopping list item
---
.../apache/ofbiz/order/shoppinglist/ShoppingListServicesScript.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/applications/order/src/main/groovy/org/apache/ofbiz/order/shoppinglist/ShoppingListServicesScript.groovy
b/applications/order/src/main/groovy/org/apache/ofbiz/order/shoppinglist/ShoppingListServicesScript.groovy
index 8384fe26ca..f94fbc34a3 100644
---
a/applications/order/src/main/groovy/org/apache/ofbiz/order/shoppinglist/ShoppingListServicesScript.groovy
+++
b/applications/order/src/main/groovy/org/apache/ofbiz/order/shoppinglist/ShoppingListServicesScript.groovy
@@ -87,7 +87,7 @@ Map createShoppingListItem() {
.queryList()
if ((!slItemAttributes && !parameters.shoppingListItemAttributes)
||
Objects.equals(slItemAttributes,
parameters.shoppingListItemAttributes)) {
- BigDecimal totalquantity = shoppingListItem.quantity +
parameters.quantity
+ BigDecimal totalquantity = (shoppingListItem.quantity ?:
BigDecimal.ZERO) + (parameters.quantity ?: BigDecimal.ZERO)
result.shoppingListItemSeqId =
shoppingListItem.shoppingListItemSeqId
Map serviceResult = run service: 'updateShoppingListItem',
with: [*: shoppingListItem, quantity: totalquantity]
require(ServiceUtil.isSuccess(serviceResult) as boolean,
serviceResult.errorMessage)
@@ -282,7 +282,7 @@ Map addSuggestionsToShoppingList() {
.filterByDate()
.queryFirst()
if (virtualProductAssoc) {
- linkProductToShoppingList(virtualProductAssoc.productIdTo,
shoppingListId)
+ linkProductToShoppingList(virtualProductAssoc.productId,
shoppingListId)
}
}
}