Project: 	
  | View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | ||||||||||||
| 0030900 | ||||||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
| defect | [Openbravo ERP] Z. Others | minor | always | 2015-09-23 16:22 | 2015-09-23 16:22 | |||||||
| Reporter | rbianchini | View Status | public | |||||||||
| Assigned To | Triage Omni OMS | |||||||||||
| Priority | normal | Resolution | open | Fixed in Version | ||||||||
| Status | new | Fix in branch | Fixed in SCM revision | |||||||||
| Projection | none | ETA | none | Target Version | ||||||||
| OS | Any | Database | Any | Java version | ||||||||
| OS Version | Database version | Ant version | ||||||||||
| Product Version | 3.0PR15Q1.4 | SCM revision | ||||||||||
| Merge Request Status | ||||||||||||
| Review Assigned To | ||||||||||||
| OBNetwork customer | No | |||||||||||
| Web browser | ||||||||||||
| Modules | Core | |||||||||||
| Support ticket | 37040 | |||||||||||
| Regression level | ||||||||||||
| Regression date | ||||||||||||
| Regression introduced in release | ||||||||||||
| Regression introduced by commit | ||||||||||||
| Triggers an Emergency Pack | No | |||||||||||
| Summary | 0030900: Widget with null Date field cannot be exported | |||||||||||
| Description | When 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 Reproduce | Create a widjet with an optional column date which can be null. Try to export to CSV Observes the error in the CSV file  | |||||||||||
| Proposed Solution | Apply 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); }  | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
		  Relationships		[ Relation Graph ] 
		[ Dependency Graph ] 
			 | 
|
  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 | OBNetwork customer | => No | 
| 2015-09-23 16:22 | rbianchini | Modules | => Core | 
| 2015-09-23 16:22 | rbianchini | Support ticket | => 37040 | 
| 2015-09-23 16:22 | rbianchini | Triggers an Emergency Pack | => No | 
| Copyright © 2000 - 2009 MantisBT Group |