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 4c365ae15b Use the delegator's model reader for dynamic views in 
performFind
4c365ae15b is described below

commit 4c365ae15b41013c4cf189c033ed5325d500bbd0
Author: Mridul Pathak <[email protected]>
AuthorDate: Sun Nov 1 09:03:31 2026 +0530

    Use the delegator's model reader for dynamic views in performFind
    
    prepareFind looked up the model reader by the delegator's full name, which 
for a tenant delegator includes the tenant ID and is not a configured 
delegator, so a performFind with a dynamicViewEntity failed. It now uses 
DynamicViewEntity.makeModelViewEntity, which takes the model reader from the 
delegator.
---
 .../src/main/java/org/apache/ofbiz/common/FindServices.java       | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git 
a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java 
b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
index 0a3b35b037..453208217d 100644
--- a/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
+++ b/framework/common/src/main/java/org/apache/ofbiz/common/FindServices.java
@@ -57,8 +57,6 @@ import org.apache.ofbiz.entity.condition.EntityOperator;
 import org.apache.ofbiz.entity.model.DynamicViewEntity;
 import org.apache.ofbiz.entity.model.ModelEntity;
 import org.apache.ofbiz.entity.model.ModelField;
-import org.apache.ofbiz.entity.model.ModelReader;
-import org.apache.ofbiz.entity.model.ModelViewEntity;
 import org.apache.ofbiz.entity.util.EntityListIterator;
 import org.apache.ofbiz.entity.util.EntityQuery;
 import org.apache.ofbiz.entity.util.EntityUtil;
@@ -616,11 +614,7 @@ public class FindServices {
         Map<String, Object> queryStringMap = new LinkedHashMap<>();
         ModelEntity modelEntity;
         if (dynamicViewEntity != null) {
-            try {
-                modelEntity = new ModelViewEntity(dynamicViewEntity, 
ModelReader.getModelReader(delegator.getDelegatorName()));
-            } catch (GenericEntityException e) {
-                return ServiceUtil.returnError(e.toString());
-            }
+            modelEntity = dynamicViewEntity.makeModelViewEntity(delegator);
         } else {
             modelEntity = delegator.getModelEntity(entityName);
         }

Reply via email to