Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030900
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersminoralways2015-09-23 16:222015-09-23 16:22
ReporterrbianchiniView Statuspublic 
Assigned ToTriage Omni OMS 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0PR15Q1.4SCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030900: Widget with null Date field cannot be exported

DescriptionWhen a widget that has a date column that is an optional column which can be null, if you try to export the data to CSV, you will encounter a error that the CSV file contains only:

{"response":{"status":-4,"error":{"message":"Cannot format given Object as a
Date","type":"system"}}}



The stacktrace shows:

ERROR org.openbravo.service.datasource.DataSourceServlet - Cannot format
given Object as a Date

java.lang.IllegalArgumentException: Cannot format given Object as a Date

at java.text.DateFormat.format(DateFormat.java:281)

at java.text.Format.format(Format.java:140)

at
org.openbravo.client.querylist.QueryListDataSource.getData(QueryListDataSour
ce.java:270)

at
org.openbravo.service.datasource.ReadOnlyDataSourceService.fetchJSONObject(R
eadOnlyDataSourceService.java:137)

at
org.openbravo.service.datasource.ReadOnlyDataSourceService.fetch(ReadOnlyDat
aSourceService.java:116)

at
org.openbravo.service.datasource.DataSourceServlet.doFetch(DataSourceServlet
..java:251)

at
org.openbravo.service.datasource.DataSourceServlet.doPost(DataSourceServlet.
java:754)

and so on ..


Steps To ReproduceCreate a widjet with an optional column date which can be null.
Try to export to CSV
Observes the error in the CSV file
Proposed SolutionApply this patch:
diff --git a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
--- a/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
+++ b/modules/org.openbravo.client.querylist/src/org/openbravo/client/querylist/QueryListDataSource.java
@@ -267,9 +267,10 @@
                   || (!isExport && queryAliases[i].equals(column.getLinkExpression()))) {
                 Object value = resultList[i];
                 if (domainType instanceof DateDomainType || domainType instanceof DateDomainType) {
+ if (value != null) {
                     value = xmlDateFormat.format(value);
                   }
- else if (value instanceof Timestamp) {
+ } else if (value instanceof Timestamp) {
                   value = xmlDateTimeFormat.format(value);
                   value = JsonUtils.convertToCorrectXSDFormat((String) value);
                 }
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2015-09-23 16:22 rbianchini New Issue
2015-09-23 16:22 rbianchini Assigned To => Triage Finance
2015-09-23 16:22 rbianchini Modules => Core
2015-09-23 16:22 rbianchini Triggers an Emergency Pack => No


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker