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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0038842
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersminoralways2018-06-26 16:402022-02-01 07:24
Reportermatias-bernalView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesJSON Datasource
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0038842: Exception occurs when converting JSON to Base OB Object when JSON contains "updated" property, and object is new

DescriptionWhen 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 Reproduce1. 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 SolutionMove 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.
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
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
Powered by Mantis Bugtracker