[jira] [Created] (OFBIZ-4393) View entity condition-expr doesn't handle null

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148107#comment-13148107 ]

Anne Jessel commented on OFBIZ-4393:
------------------------------------

I've tested a combination of Adrian's approach and Leon's comments regarding relFieldName, and uploaded a new patch. I can confirm it works for my use case. A condition-expr in a view-entity that has no value or rel-field-name will now correctly compare with null.

In reviewing the relevant code, I did notice a potential change in behaviour with this approach. Because an absent value and value="" are treated the same way, a NOT_EQUAL comparison with the empty string will be treated as a NOT_EQUAL test with null instead.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148121#comment-13148121 ]

Anne Jessel commented on OFBIZ-4393:
------------------------------------

On consideration, I don't think the change in behaviour is a major problem. This patch supports EQUALS with null, which the previous code did not support. IMO comparisons with null are very useful. However we lose the specific NOT_EQUAL with empty string, IMO an uncommon test, especially in a view-entity. Overall a big gain, but perhaps not yet a perfect solution.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148216#comment-13148216 ]

Adrian Crum commented on OFBIZ-4393:
------------------------------------

Since a comparison with an empty String instead of a null value is unlikely, I agree with Anne that in a view entity the distinction is irrelevant. Unless there are any objections, I will commit the change.

               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13148305#comment-13148305 ]

Jacques Le Roux commented on OFBIZ-4393:
----------------------------------------

Yes, actually no need to revert r1195042 (even if it will be then useless)
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux updated OFBIZ-4393:
-----------------------------------

    Affects Version/s: Release Branch 11.04
                       Release Branch 10.04

From Deepak's remark
{quote}
This is a bug, so this should be go in branches as well(10.04 and 11.04).
I have tested it for release10.04 (did manual merge) and it works fine.
{quote}

I have added the releases, I can backport if necessary


               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149019#comment-13149019 ]

Leon commented on OFBIZ-4393:
-----------------------------

I suggest to revert r1195042. It will make things more clear: if the value is null and relField is null, then the right hand value will be treated as "null" value.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adrian Crum closed OFBIZ-4393.
------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk

Patch committed to trunk, rev 1201232. Thank you everyone for your comments and review.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149140#comment-13149140 ]

Jacques Le Roux commented on OFBIZ-4393:
----------------------------------------

Too much troubles, I did not backport, sorry
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepak Dixit updated OFBIZ-4393:
--------------------------------

    Attachment: OFBIZ-4393-release.patch

Here is the patch for release 10.04 and 11.04.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-release.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149453#comment-13149453 ]

Deepak Dixit commented on OFBIZ-4393:
-------------------------------------

Hello Jacques,

I have attached patch for release 10.04 and release 11.04.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-release.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149488#comment-13149488 ]

Jacques Le Roux commented on OFBIZ-4393:
----------------------------------------

Thanks Deepak,

Your patch is in
R11.04 r1201628  
R10.04 r1201627

               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-release.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-4393) View entity condition-expr doesn't handle null

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-4393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149490#comment-13149490 ]

Deepak Dixit commented on OFBIZ-4393:
-------------------------------------

Thanks Jacques.
               

> View entity condition-expr doesn't handle null
> ----------------------------------------------
>
>                 Key: OFBIZ-4393
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4393
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04, Release Branch 11.04, SVN trunk
>         Environment: Rev 1165137
>            Reporter: Anne Jessel
>            Assignee: Adrian Crum
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4393-release.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch, OFBIZ-4393-view-entity_condition-expr_null.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> condition-expr tag in view-entity can't be used to compare a field with null. An absent value attribute is read as an empty string, and the code currently checks for value being null to know when to compare against null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
12