trival update to EntityFieldValue.java in case the entityAlias is empty
----------------------------------------------------------------------- Key: OFBIZ-4331 URL: https://issues.apache.org/jira/browse/OFBIZ-4331 Project: OFBiz Issue Type: Bug Components: framework Affects Versions: SVN trunk Reporter: Leon Priority: Trivial Fix For: SVN trunk Attachments: EntityFieldValue.patch Sometimes, there's only one member entity in a view. In such case, you can omit the "entity-alias" in entity condition setting. In this situation, the entityAlias is not "null" but an emtpty string. =================================================================== --- framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (revision 1513) +++ framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (working copy) @@ -124,7 +124,7 @@ @Override public ModelField getModelField(ModelEntity modelEntity) { if (this.modelViewEntity != null) { - if (this.entityAlias != null) { + if (UtilValidate.isNotEmpty(this.entityAlias)) { ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias); return getField(memberModelEntity, fieldName); } else { -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/OFBIZ-4331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leon updated OFBIZ-4331: ------------------------ Attachment: EntityFieldValue.patch > trival update to EntityFieldValue.java in case the entityAlias is empty > ----------------------------------------------------------------------- > > Key: OFBIZ-4331 > URL: https://issues.apache.org/jira/browse/OFBIZ-4331 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Leon > Priority: Trivial > Fix For: SVN trunk > > Attachments: EntityFieldValue.patch > > > Sometimes, there's only one member entity in a view. In such case, you can omit the "entity-alias" in entity condition setting. In this situation, the entityAlias is not "null" but an emtpty string. > =================================================================== > --- framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (revision 1513) > +++ framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (working copy) > @@ -124,7 +124,7 @@ > @Override > public ModelField getModelField(ModelEntity modelEntity) { > if (this.modelViewEntity != null) { > - if (this.entityAlias != null) { > + if (UtilValidate.isNotEmpty(this.entityAlias)) { > ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias); > return getField(memberModelEntity, fieldName); > } else { -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060718#comment-13060718 ] Adam Heath commented on OFBIZ-4331: ----------------------------------- Please don't apply this change. The change is not wrong, per se, but that entire block of code is a hack. With my recent view sql work, and one more change I have queued, this entire class will no longer be dealing with entityAlias stuff at all, in the near future. Tbh, this code block should have never been added to EntityFieldValue; instead, a new class that extends EntityConditionValue should have been created. But I digress... > trival update to EntityFieldValue.java in case the entityAlias is empty > ----------------------------------------------------------------------- > > Key: OFBIZ-4331 > URL: https://issues.apache.org/jira/browse/OFBIZ-4331 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Leon > Priority: Trivial > Fix For: SVN trunk > > Attachments: EntityFieldValue.patch > > > Sometimes, there's only one member entity in a view. In such case, you can omit the "entity-alias" in entity condition setting. In this situation, the entityAlias is not "null" but an emtpty string. > =================================================================== > --- framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (revision 1513) > +++ framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (working copy) > @@ -124,7 +124,7 @@ > @Override > public ModelField getModelField(ModelEntity modelEntity) { > if (this.modelViewEntity != null) { > - if (this.entityAlias != null) { > + if (UtilValidate.isNotEmpty(this.entityAlias)) { > ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias); > return getField(memberModelEntity, fieldName); > } else { -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060727#comment-13060727 ] Adam Heath commented on OFBIZ-4331: ----------------------------------- Altho, thanks for mentioning the empty attribute value condition, I'll add that to my testing. > trival update to EntityFieldValue.java in case the entityAlias is empty > ----------------------------------------------------------------------- > > Key: OFBIZ-4331 > URL: https://issues.apache.org/jira/browse/OFBIZ-4331 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Leon > Priority: Trivial > Fix For: SVN trunk > > Attachments: EntityFieldValue.patch > > > Sometimes, there's only one member entity in a view. In such case, you can omit the "entity-alias" in entity condition setting. In this situation, the entityAlias is not "null" but an emtpty string. > =================================================================== > --- framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (revision 1513) > +++ framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (working copy) > @@ -124,7 +124,7 @@ > @Override > public ModelField getModelField(ModelEntity modelEntity) { > if (this.modelViewEntity != null) { > - if (this.entityAlias != null) { > + if (UtilValidate.isNotEmpty(this.entityAlias)) { > ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias); > return getField(memberModelEntity, fieldName); > } else { -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13061068#comment-13061068 ] Leon commented on OFBIZ-4331: ----------------------------- Agree with you. Redesign is better than patch on patch. So far, we can add the "entity-alias" explicitly to bypass this bug. > trival update to EntityFieldValue.java in case the entityAlias is empty > ----------------------------------------------------------------------- > > Key: OFBIZ-4331 > URL: https://issues.apache.org/jira/browse/OFBIZ-4331 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Reporter: Leon > Priority: Trivial > Fix For: SVN trunk > > Attachments: EntityFieldValue.patch > > > Sometimes, there's only one member entity in a view. In such case, you can omit the "entity-alias" in entity condition setting. In this situation, the entityAlias is not "null" but an emtpty string. > =================================================================== > --- framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (revision 1513) > +++ framework/entity/src/org/ofbiz/entity/condition/EntityFieldValue.java (working copy) > @@ -124,7 +124,7 @@ > @Override > public ModelField getModelField(ModelEntity modelEntity) { > if (this.modelViewEntity != null) { > - if (this.entityAlias != null) { > + if (UtilValidate.isNotEmpty(this.entityAlias)) { > ModelEntity memberModelEntity = modelViewEntity.getMemberModelEntity(entityAlias); > return getField(memberModelEntity, fieldName); > } else { -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |