You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/09/29 16:29:26 UTC
(ofbiz-framework) branch trunk updated: Fixed: followPartyRelationshipsInline() silently returns zero relationships instead of unrestricted (OFBIZ-13627)
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 f197726904 Fixed: followPartyRelationshipsInline() silently returns zero relationships instead of unrestricted (OFBIZ-13627)
f197726904 is described below
commit f19772690481cbb729e7e33ad115362fb39cae5f
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Tue Sep 29 20:52:01 2026 +0530
Fixed: followPartyRelationshipsInline() silently returns zero relationships instead of unrestricted (OFBIZ-13627)
[roleTypeIdFrom] + childList produced [null] when roleTypeIdFrom was empty — a non-empty (truthy) list containing a literal null, which built a roleTypeIdFrom IN (NULL) condition that never matches any row. Mini-lang dropped the filter entirely in this case, searching unrestricted. Reachable via the public getRelatedParties service. Side effect of OFBIZ-13593's fix, which handled the non-empty-seed case but not this one. Applied the same fix symmetrically to roleTypeIdTo.
---
.../groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
index 0786627a75..bf846eaf1b 100644
--- a/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
+++ b/applications/party/src/main/groovy/org/apache/ofbiz/party/party/PartyServicesScript.groovy
@@ -820,7 +820,8 @@ Map followPartyRelationshipsInline(List relatedPartyIdList, String partyRelation
if (roleTypeIdFromIncludeAllChildTypes == 'Y') {
List roleTypeIdListName = roleTypeIdFromList
Map res = getChildRoleTypesInline(roleTypeIdListName)
- roleTypeIdFromList = [roleTypeIdFrom] + (res.childRoleTypeIdList ?: [])
+ List childRoleTypeIdFromList = res.childRoleTypeIdList ?: []
+ roleTypeIdFromList = roleTypeIdFrom ? [roleTypeIdFrom] + childRoleTypeIdFromList : childRoleTypeIdFromList
}
List roleTypeIdToList = null
@@ -830,7 +831,8 @@ Map followPartyRelationshipsInline(List relatedPartyIdList, String partyRelation
if (roleTypeIdToInclueAllChildTypes == 'Y') {
List roleTypeIdListName = roleTypeIdToList
Map res = getChildRoleTypesInline(roleTypeIdListName)
- roleTypeIdToList = [roleTypeIdTo] + (res.childRoleTypeIdList ?: [])
+ List childRoleTypeIdToList = res.childRoleTypeIdList ?: []
+ roleTypeIdToList = roleTypeIdTo ? [roleTypeIdTo] + childRoleTypeIdToList : childRoleTypeIdToList
}
Map res = followPartyRelationshipsInlineRecurse(relatedPartyIdList, roleTypeIdFromList, roleTypeIdToList,