This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 08e7667ed7 Fixed: followPartyRelationshipsInline() silently returns 
zero relationships instead of unrestricted (OFBIZ-13627)
08e7667ed7 is described below

commit 08e7667ed7a37f5159be3d0ca126f764469d73aa
Author: Mridul Pathak <[email protected]>
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 d15052c648..78528f9de3 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
@@ -827,7 +827,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
@@ -837,7 +838,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,

Reply via email to