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 36893b830a Use the delegator's model reader for dynamic views in
performFind
36893b830a is described below
commit 36893b830aff201f3e1ae998f8161d5c7f396751
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.
(cherry picked from commit 0da48d38d754748a74aa2f59b8b2d91a1ea3f26c)
---
.../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 239a013167..4f1bddd357 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
@@ -54,8 +54,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;
@@ -620,11 +618,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);
}