svn commit: r1139869 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1139869 - /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java

doogie-3
Author: doogie
Date: Sun Jun 26 18:08:53 2011
New Revision: 1139869

URL: http://svn.apache.org/viewvc?rev=1139869&view=rev
Log:
FIX: getModelField: when fetching the ModelField, handle the
case of the field being part of a ModelViewEntity.

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java?rev=1139869&r1=1139868&r2=1139869&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java Sun Jun 26 18:08:53 2011
@@ -123,6 +123,14 @@ public class EntityFieldValue extends En
 
     @Override
     public ModelField getModelField(ModelEntity modelEntity) {
+        if (this.modelViewEntity != null) {
+            if (this.entityAlias != null) {
+                ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias);
+                return getField(memberModelEntity, fieldName);
+            } else {
+                return getField(modelViewEntity, fieldName);
+            }
+        }
         return getField(modelEntity, fieldName);
     }