[jira] [Created] (OFBIZ-4932) Not getting right behavior of use-when when using in multi

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

[jira] [Created] (OFBIZ-4932) Not getting right behavior of use-when when using in multi

Nicolas Malin (Jira)
Daniel Riquelme created OFBIZ-4932:
--------------------------------------

             Summary: Not getting right behavior of use-when when using in multi
                 Key: OFBIZ-4932
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: SVN trunk
            Reporter: Daniel Riquelme
            Priority: Minor


The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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-4932) Not getting right behavior of use-when when using in multi

Nicolas Malin (Jira)

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

Daniel Riquelme updated OFBIZ-4932:
-----------------------------------

    Attachment: OFBIZ-4932_MultiLListUseWhen.patch

Multi List Use When Patch
               

> Not getting right behavior of use-when when using in multi
> ----------------------------------------------------------
>
>                 Key: OFBIZ-4932
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>            Priority: Minor
>         Attachments: OFBIZ-4932_MultiLListUseWhen.patch
>
>
> The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
> What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
> The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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] [Assigned] (OFBIZ-4932) Not getting right behavior of use-when when using in multi

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

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

Jacques Le Roux reassigned OFBIZ-4932:
--------------------------------------

    Assignee: Jacques Le Roux
   

> Not getting right behavior of use-when when using in multi
> ----------------------------------------------------------
>
>                 Key: OFBIZ-4932
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: OFBIZ-4932_MultiLListUseWhen.patch
>
>
> The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
> What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
> The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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-4932) Not getting right behavior of use-when when using in multi

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

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

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

Hi Daniel,

Is there an easy use case to test OOTB? Else what did you use to test this change?
               

> Not getting right behavior of use-when when using in multi
> ----------------------------------------------------------
>
>                 Key: OFBIZ-4932
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: OFBIZ-4932_MultiLListUseWhen.patch
>
>
> The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
> What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
> The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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-4932) Not getting right behavior of use-when when using in multi

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

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

Daniel Riquelme commented on OFBIZ-4932:
----------------------------------------

Yes, you may test it by modifying the file:

applications/accounting/widget/InvoiceForms.xml line: 368
(EditInvoiceItems)

add the following use when condition to field quantity:

use-when="quantity!=null @and quantity.compareTo(java.math.BigDecimal.ONE)==0"

Go to https://localhost:8443/accounting/control/listInvoiceItems?invoiceId=demo10001&invoiceItemSeqId=00002

You will get an "...Error evaluating BeanShell use-when condition ..."

Apply the patch

You will get expected behavior.
               

> Not getting right behavior of use-when when using in multi
> ----------------------------------------------------------
>
>                 Key: OFBIZ-4932
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: OFBIZ-4932_MultiLListUseWhen.patch
>
>
> The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
> What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
> The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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-4932) Not getting right behavior of use-when when using in multi

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

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

Jacques Le Roux closed OFBIZ-4932.
----------------------------------

       Resolution: Fixed
    Fix Version/s: Release Branch 12.04
                   SVN trunk
                   Release Branch 11.04
                   Release Branch 10.04

Thanks Daniel,

Your patch is in
trunk r1358735  
R12.04 r1358736  
R11.04 r1358737  
R10.04 r1358738  


               

> Not getting right behavior of use-when when using in multi
> ----------------------------------------------------------
>
>                 Key: OFBIZ-4932
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4932
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>            Assignee: Jacques Le Roux
>            Priority: Minor
>             Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk, Release Branch 12.04
>
>         Attachments: OFBIZ-4932_MultiLListUseWhen.patch
>
>
> The problem is that on multi forms the bshInterpreter gets pushed to higher levels on the context stack when iterating the form rows.
> What is intended in the code is to reset the bshInterpreter (this.resetBshInterpreter(context);) for each row iteration, this reset translates into a key object being removed from context, this context is stored in a stack data structure. The removal assumes the value will always be at level 0, yet what happens is that the value resides at a higher level.
> The fix is to perform the removal prior to context modification, this way the bshInterpereter object would be at level 0 upon removal.

--
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