Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0022481 | Openbravo ERP | A. Platform | public | 2012-12-07 12:50 | 2012-12-26 07:14 |
Reporter | vmromanos | ||||
Assigned To | AugustoMauch | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 20 | OS Version | Debian 5.0 | |
Product Version | pi | ||||
Target Version | 3.0MP19 | Fixed in Version | pi | ||
Merge Request Status | |||||
Review Assigned To | shankarb | ||||
OBNetwork customer | No | ||||
Web browser | |||||
Modules | Core | ||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0022481: DateTime in selector filter expression | ||||
Description | I have defined a new selector with a filter expression that contains the following code: OB.getParameters().get('inpstartTime') where inpstartTime represents a DateTime field. When I try to use this selector into the tab (for example showing the dropdown list), I get the following exception: a3196480 3974149 [http-8080-5] ERROR org.openbravo.client.application.OBBindings - Error parsing string date 2012-12-26T11:36:42 with format: java.text.SimpleDateFormat@542bf360 or format: java.text.SimpleDateFormat@6b2ed43a java.text.ParseException: Unparseable date: "2012-12-26T11:36:42" at java.text.DateFormat.parse(DateFormat.java:337) at org.openbravo.client.application.OBBindings.parseDateTime(OBBindings.java:186) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37) at sun.reflect.GeneratedMethodAccessor662.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244) at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:132) at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(NativeJavaMethod.java:190) at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:3073) at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:2239) at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:138) at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:323) at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:2747) at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:149) at sun.org.mozilla.javascript.internal.Context.evaluateReader(Context.java:1169) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:106) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247) at org.openbravo.client.application.ParameterUtils.getJSExpressionResult(ParameterUtils.java:160) at org.openbravo.userinterface.selector.SelectorDataSourceFilter.applyFilterExpression(SelectorDataSourceFilter.java:220) at org.openbravo.userinterface.selector.SelectorDataSourceFilter.doFilter(SelectorDataSourceFilter.java:94) at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:191) at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:611) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225) at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:435) at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87) at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63) at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:125) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.activiti.OBActivitiRequestFilter$1.doAction(OBActivitiRequestFilter.java:68) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.activiti.OBActivitiRequestFilter.doFilter(OBActivitiRequestFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) a3196480 3974152 [http-8080-5] ERROR org.openbravo.userinterface.selector.SelectorDataSourceFilter - Error evaluating filter expression: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.NullPointerException (<Unknown source>#1) in <Unknown source> at line number 1 javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.NullPointerException (<Unknown source>#1) in <Unknown source> at line number 1 at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124) at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247) at org.openbravo.client.application.ParameterUtils.getJSExpressionResult(ParameterUtils.java:160) at org.openbravo.userinterface.selector.SelectorDataSourceFilter.applyFilterExpression(SelectorDataSourceFilter.java:220) at org.openbravo.userinterface.selector.SelectorDataSourceFilter.doFilter(SelectorDataSourceFilter.java:94) at org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet.java:191) at org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.java:611) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:225) at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:435) at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:87) at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:63) at org.openbravo.service.datasource.DataSourceServlet.service(DataSourceServlet.java:125) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.activiti.OBActivitiRequestFilter$1.doAction(OBActivitiRequestFilter.java:68) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.activiti.OBActivitiRequestFilter.doFilter(OBActivitiRequestFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.utils.SessionExpirationFilter.doFilter(SessionExpirationFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.utils.CharsetFilter.doFilter(CharsetFilter.java:35) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.client.kernel.KernelFilter$1.doAction(KernelFilter.java:62) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.client.kernel.KernelFilter.doFilter(KernelFilter.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.openbravo.dal.core.DalRequestFilter$1.doAction(DalRequestFilter.java:81) at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:46) at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:103) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:662) As you can see, the OBBindings class receives the parameter "2012-12-26T11:36:42". Here we have two problems: 1. The date contains a 'T' inside 2. The date has been transformed to UTC format (in the form I have introduced 12:36:42) | ||||
Steps To Reproduce | 1. Create a new selector with a filter expression that contains a DateTime field 2. Try to use it | ||||
Proposed Solution | The OBBindings class should properly parse the date, which is written in JS format. Moreover it should by adjusted to localtime from the UTC. Find attached a patch that fixed the problem for me. Please review it and ensure it doesn't break anything else | ||||
Additional Information | |||||
Tags | Coworking | ||||
Relationships | |||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=5802&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=5829&type=bug | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2012-12-07 12:50 | vmromanos | New Issue | |||
2012-12-07 12:50 | vmromanos | Assigned To | => AugustoMauch | ||
2012-12-07 12:50 | vmromanos | File Added: OBBindings_jsdatetimeformat.diff | |||
2012-12-07 12:50 | vmromanos | Modules | => Core | ||
2012-12-07 12:50 | vmromanos | OBNetwork customer | => No | ||
2012-12-07 12:50 | vmromanos | Triggers an Emergency Pack | => No | ||
2012-12-10 17:32 | vmromanos | Tag Attached: Coworking | |||
2012-12-13 12:07 | AugustoMauch | File Added: issue22481.diff | |||
2012-12-13 12:09 | AugustoMauch | Status | new => scheduled | ||
2012-12-13 12:09 | AugustoMauch | fix_in_branch | => pi | ||
2012-12-14 10:14 | AugustoMauch | Issue Monitored: dbaz | |||
2012-12-14 10:14 | AugustoMauch | Review Assigned To | => dbaz | ||
2012-12-14 10:14 | AugustoMauch | fix_in_branch | pi => | ||
2012-12-14 10:26 | hgbot | Checkin | |||
2012-12-14 10:26 | hgbot | Note Added: 0054935 | |||
2012-12-14 10:26 | hgbot | Status | scheduled => resolved | ||
2012-12-14 10:26 | hgbot | Resolution | open => fixed | ||
2012-12-14 10:26 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/3db450e737fd5a6d4ac562a115b07ef2ac32506f [^] | ||
2012-12-17 13:34 | hudsonbot | Checkin | |||
2012-12-17 13:34 | hudsonbot | Note Added: 0055011 | |||
2012-12-24 13:38 | AugustoMauch | Review Assigned To | dbaz => shankarb | ||
2012-12-26 07:14 | shankarb | Note Added: 0055187 | |||
2012-12-26 07:14 | shankarb | Status | resolved => closed | ||
2012-12-26 07:14 | shankarb | Fixed in Version | => pi |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|