Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0022481 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | always | 2012-12-07 12:50 | 2012-12-26 07:14 | |||
Reporter | vmromanos | View Status | public | |||||
Assigned To | AugustoMauch | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | pi | |||
Status | closed | Fix in branch | Fixed in SCM revision | 3db450e737fd | ||||
Projection | none | ETA | none | Target Version | 3.0MP19 | |||
OS | Linux 32 bit | Database | PostgreSQL | Java version | 1.6.0_12 | |||
OS Version | Debian 5.0 | Database version | 8.3.8 | Ant version | 1.7.0 | |||
Product Version | pi | SCM revision | ||||||
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 | |||||||
Tags | Coworking | |||||||
Attached Files | ![]() ![]() | |||||||
![]() |
|
![]() |
|
(0054935) hgbot (developer) 2012-12-14 10:26 |
Repository: erp/devel/pi Changeset: 3db450e737fd5a6d4ac562a115b07ef2ac32506f Author: Augusto Mauch <augusto.mauch <at> openbravo.com> Date: Fri Dec 14 10:26:11 2012 +0100 URL: http://code.openbravo.com/erp/devel/pi/rev/3db450e737fd5a6d4ac562a115b07ef2ac32506f [^] Fixes issue 22481: DateTime columns can be used in a selector filter expression OBBindings was incorrectly assuming that the format of the date filters was going to be Java's one ('dd-MM-yyyy HH:mm:ss'), but the method parseDateTime is only called from the client, and DateTime values are provided in the javascript format ('yyyy-MM-dd'T'HH:mm:ss'). Apart from that, the dates, that arrive as an UTC date, are converted to the server timezone. --- M modules/org.openbravo.client.application/src/org/openbravo/client/application/OBBindings.java --- |
(0055011) hudsonbot (viewer) 2012-12-17 13:34 |
A changeset related to this issue has been promoted main and to the Central Repository, after passing a series of tests. Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/c79ef1b1f830 [^] Maturity status: Test |
(0055187) shankarb (viewer) 2012-12-26 07:14 |
Tested and Verified in pi @ changeset faf2790df3d2 |
![]() |
|||
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 |
Copyright © 2000 - 2009 MantisBT Group |