You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2012/03/19 06:38:59 UTC

svn commit: r1302274 - /ofbiz/trunk/applications/accounting/widget/GlForms.xml

Author: jacopoc
Date: Mon Mar 19 05:38:58 2012
New Revision: 1302274

URL: http://svn.apache.org/viewvc?rev=1302274&view=rev
Log:
Fixed issue reported in OFBIZ-4731: the ${bsh: syntaxt when used in value fields doesn't seem to work properly after the recent refactoring to the ScriptUtil and related mechanisms. Fixed by switching to ${groovy: syntax.
Even if there are plans to migrate all the scripts to the ${groovy: syntax, we will have to fix the root cause of this, also because there are several other occurrencies of the older sytax in the system.


Modified:
    ofbiz/trunk/applications/accounting/widget/GlForms.xml

Modified: ofbiz/trunk/applications/accounting/widget/GlForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlForms.xml?rev=1302274&r1=1302273&r2=1302274&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlForms.xml Mon Mar 19 05:38:58 2012
@@ -275,7 +275,7 @@ under the License.
             </entity-condition>
         </actions>
         <row-actions>
-            <set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;glAccountId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(glAccountId)));}" type="Boolean"/>
+            <set field="showPosition1" value="${groovy:String prev=(String)previousItem.get(&quot;glAccountId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(glAccountId)));}" type="Boolean"/>
         </row-actions>
         <field name="glAccountId" position="1" use-when="showPosition1"><display/></field>
         <field name="glAccountDescription" title="${uiLabelMap.CommonDescription}" position="1" use-when="showPosition1">



Fwd: svn commit: r1302274 - /ofbiz/trunk/applications/accounting/widget/GlForms.xml

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Adrian,

will you have a chance to look at this issue?

The relevant part of the error log in the console was (the last three lines show the exact point of error in the stack trace):

Error running bsh script [String prev=(String)previousItem.get("glAccountId");return new Boolean(!(prev!=null
&&prev.equals(glAccountId)));]: javax.script.ScriptException: Sourced file: inline evaluation of: `
`
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : Attempt to resolve method: equals() on undefined variable or class name: prev : at Line: 1 : in file: inline evalua
tion of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : prev .equals ( glAccountId )
 in inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' at line number 1
Exception: javax.script.ScriptException
Message: Sourced file: inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : Attempt to resolve method: equals() on undefined variable or class na
me: prev : at Line: 1 : in file: inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : prev .equals ( glAccountId )
 in inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' at line number 1
---- stack trace ---------------------------------------------------------------
javax.script.ScriptException: Sourced file: inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : Attempt to resolve method: equals() on undefined
 variable or class name: prev : at Line: 1 : in file: inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' : prev .equals ( glAccountId )
 in inline evaluation of: ``
String prev=(String)previousItem.get("glAccountId");return new Boolean
(!(prev!=n . . . '' at line number 1
bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:92)
bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
org.ofbiz.base.util.ScriptUtil.evaluate(ScriptUtil.java:272)

Regards,

Jacopo

Begin forwarded message:

> From: jacopoc@apache.org
> Subject: svn commit: r1302274 - /ofbiz/trunk/applications/accounting/widget/GlForms.xml
> Date: March 19, 2012 6:38:59 AM GMT+01:00
> To: commits@ofbiz.apache.org
> Reply-To: dev@ofbiz.apache.org
> 
> Author: jacopoc
> Date: Mon Mar 19 05:38:58 2012
> New Revision: 1302274
> 
> URL: http://svn.apache.org/viewvc?rev=1302274&view=rev
> Log:
> Fixed issue reported in OFBIZ-4731: the ${bsh: syntaxt when used in value fields doesn't seem to work properly after the recent refactoring to the ScriptUtil and related mechanisms. Fixed by switching to ${groovy: syntax.
> Even if there are plans to migrate all the scripts to the ${groovy: syntax, we will have to fix the root cause of this, also because there are several other occurrencies of the older sytax in the system.
> 
> 
> Modified:
>    ofbiz/trunk/applications/accounting/widget/GlForms.xml
> 
> Modified: ofbiz/trunk/applications/accounting/widget/GlForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlForms.xml?rev=1302274&r1=1302273&r2=1302274&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/widget/GlForms.xml (original)
> +++ ofbiz/trunk/applications/accounting/widget/GlForms.xml Mon Mar 19 05:38:58 2012
> @@ -275,7 +275,7 @@ under the License.
>             </entity-condition>
>         </actions>
>         <row-actions>
> -            <set field="showPosition1" value="${bsh:String prev=(String)previousItem.get(&quot;glAccountId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(glAccountId)));}" type="Boolean"/>
> +            <set field="showPosition1" value="${groovy:String prev=(String)previousItem.get(&quot;glAccountId&quot;);return new Boolean(!(prev!=null&amp;&amp;prev.equals(glAccountId)));}" type="Boolean"/>
>         </row-actions>
>         <field name="glAccountId" position="1" use-when="showPosition1"><display/></field>
>         <field name="glAccountDescription" title="${uiLabelMap.CommonDescription}" position="1" use-when="showPosition1">
> 
>