Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource null values transformed into undefined

    Hi,
    For this situation I am using an older version of Smartclient: 8.3 (from may 2012).

    If a DataSource JSON response contains some fields with null value, when it is handled (DataSource._handleJSONReply) these values are transformed into undefined.

    The problem is in DataSource.validateJSONRecord, where field value is compared to undefined using != operator, this comparison evaluates to false in case of null, causing this transformation.

    Is this an intentional behavior, if so, why? if not, is it something which can be fixed (in the development build I am using also for the calendar changes)?

    I created this diff (against the latest build) to solve it:
    Code:
    diff -r 37f701078f51 web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js
    --- a/web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js	Mon Sep 23 13:00:24 2013 +0200
    +++ b/web/org.openbravo.userinterface.smartclient/isomorphic/client/application/DataSource.js	Thu Sep 26 14:10:02 2013 +0200
    @@ -10531,7 +10531,7 @@
                 }
     
                 var undef;
    -            if (fieldValue != undef) {
    +            if (fieldValue !== undef) {
                     // validation fieldValue, if it is complex type
                     var fieldDS = isc.DS.get(field.type);
                     if (fieldDS && !(fieldDS.skipJSONValidation)) {
    gr. Martin
    Last edited by martintaal; 26 Sep 2013, 14:40.

    #2
    Hi Martin,
    We've submitted the change that you've suggested to Smartclient 8.3, 9.0 and 9.1. The build with this fix will be available for download tomorrow (2013-09-28)

    Regards
    Isomorphic Software

    Comment

    Working...
    X