Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0038842 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Openbravo ERP] Z. Others | minor | always | 2018-06-26 16:40 | 2022-02-01 07:24 | |||||||
Reporter | matias-bernal | View Status | public | |||||||||
Assigned To | Triage Platform Base | |||||||||||
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 | pi | SCM revision | ||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | JSON Datasource | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0038842: Exception occurs when converting JSON to Base OB Object when JSON contains "updated" property, and object is new | |||||||||||
Description | When using the Openbravo classes to convert JSON to BaseOBObject (JSONToDataConverter.java), you get an exception if the original JSON has an (non null) property with name: updated. The problem is when the code checks the dates of the "current" object versus the one of the JSON, to avoid an update when the record has been updated by other process. If the BaseOBObject is new, then the object's updated property is null (has not been set yet), then the validation between dates fails with a NPE. | |||||||||||
Steps To Reproduce | 1. Use JSON REST Webservices and send a POST to any writable entity, with all the required properties set (for example, Order). 2. Make sure your JSON has an "updated" field with a date. 3. Send the request. 4. An error should be returned by the web service: "Exception updating Order(null)". Logs show more detailed exceptions 5. Remove the "updated" property from the JSON. 6. Now the JSON should generate the entity properly. Alternatively, create a simple class that makes use of the JsonToDataConverter, and tries to convert to BaseOBObject, a JSON with the updated property set. | |||||||||||
Proposed Solution | Move the date validations after the updated property is set to the new object, or make sure that this validation is not done on new objects. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Issue History | |||
Date Modified | Username | Field | Change |
2018-06-26 16:40 | matias-bernal | New Issue | |
2018-06-26 16:40 | matias-bernal | Assigned To | => Triage Finance |
2018-06-26 16:40 | matias-bernal | Modules | => JSON Datasource |
2018-06-26 16:40 | matias-bernal | Resolution time | => 1532401200 |
2018-06-26 16:40 | matias-bernal | Triggers an Emergency Pack | => No |
2018-06-26 16:41 | matias-bernal | Issue Monitored: achaves | |
2018-06-26 16:42 | matias-bernal | Issue Monitored: szapata | |
2018-07-25 17:18 | collazoandy4 | Assigned To | Triage Finance => collazoandy4 |
2018-08-06 14:48 | ngarcia | Resolution time | 1532401200 => |
2019-10-14 15:07 | Sandrahuguet | Assigned To | collazoandy4 => Triage Finance |
2019-12-19 13:18 | dmiguelez | Assigned To | Triage Finance => platform |
2022-02-01 07:24 | alostale | Assigned To | platform => Triage Platform Base |
Copyright © 2000 - 2009 MantisBT Group |