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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0050653
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Modules] External Integration Infrastructureminoralways2022-10-27 04:572022-10-28 09:29
ReporterrtoledanoView Statuspublic 
Assigned Tortoledano 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Regression date
Regression introduced by commit
Regression level
Review Assigned To
Regression introduced in release
Summary

0050653: Exception thrown from DateDirectPropertyMapping when the property comes as an empty string value

DescriptionWhen you define a mapping using DateDirectPropertyMapping and if you try to import a date as an empty string value:
{
  date: ""
}

The import process fail with exception: "Error while importing an item: cannot be parsed to a date using the dateFormat yyyy-MM-dd"
Steps To ReproduceN/A
Proposed SolutionIn java java class modules/org.openbravo.service.external.integration/src/org/openbravo/service/external/integration/mapping/DateDirectPropertyMapping.java in line 109

Replace
  Date dateValue = value != null ? parseDate((String) value) : null;
By
  Date dateValue = !StringUtils.isBlank((String) value) ? parseDate((String) value) : null;

To also take into account the empty string value.


TagsNOR
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0142629)
hgbot (developer)
2022-10-27 05:09

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/merge_requests/30 [^]
(0142693)
hgbot (developer)
2022-10-27 18:12

Merge Request created: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/merge_requests/17 [^]
(0142705)
hgbot (developer)
2022-10-28 09:29

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration [^]
Changeset: 0be2557b44009045ff1d56ab789b6becc8670396
Author: Roberto Carlos Toledano Gómez <rctg82@gmail.com>
Date: 28-10-2022 07:29:16
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/commit/0be2557b44009045ff1d56ab789b6becc8670396 [^]

Fixed ISSUE-50653: Date/DateTime mappings treat empty string as a null value

---
M src/org/openbravo/service/external/integration/mapping/DateDirectPropertyMapping.java
M src/org/openbravo/service/external/integration/mapping/JsonDateDirectPropertyMapping.java
M src/org/openbravo/service/external/integration/mapping/JsonDateTimeDirectPropertyMapping.java
M src/org/openbravo/service/external/integration/mapping/PropertyMapping.java
---
(0142706)
hgbot (developer)
2022-10-28 09:29

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.service.external.integration/-/merge_requests/30 [^]
(0142707)
hgbot (developer)
2022-10-28 09:29

Merge request merged: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/merge_requests/17 [^]
(0142708)
hgbot (developer)
2022-10-28 09:29

Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests [^]
Changeset: 931424591df313705d385a58e10be4d58db8d1ae
Author: Roberto Carlos Toledano Gómez <rctg82@gmail.com>
Date: 28-10-2022 07:29:50
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.service.external.integration.tests/-/commit/931424591df313705d385a58e10be4d58db8d1ae [^]

Related to ISSUE-50653: Added test cases

---
M src-test/org/openbravo/service/external/integration/test/property_mappings/_import/BasicImportPropertyMappingTest.java
M src-test/org/openbravo/service/external/integration/test/property_mappings/_import/ImportJsonPropertyMappingTest.java
---

- Issue History
Date Modified Username Field Change
2022-10-27 04:57 rtoledano New Issue
2022-10-27 04:57 rtoledano Assigned To => rtoledano
2022-10-27 04:57 rtoledano Tag Attached: NOR
2022-10-27 05:09 hgbot Note Added: 0142629
2022-10-27 18:12 hgbot Note Added: 0142693
2022-10-28 09:29 hgbot Resolution open => fixed
2022-10-28 09:29 hgbot Status new => closed
2022-10-28 09:29 hgbot Note Added: 0142705
2022-10-28 09:29 hgbot Note Added: 0142706
2022-10-28 09:29 hgbot Note Added: 0142707
2022-10-28 09:29 hgbot Note Added: 0142708


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker