edina / fieldtrip-gb

Fieldtrip GB is a mobile mapping and data collection app that is available for iPhone and Android devices.
Other
1 stars 0 forks source link

null values in the assets prevents the record to be uploaded #247

Closed rgamez closed 8 years ago

rgamez commented 9 years ago

A record captured with an editor containing a non required image or audio contains a null value for those optional fields, the upload code is not handling correctly those null values.

{
  "1441275410214": {
    "record": {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          326369.12597759,
          672089.76549663,
          null
        ]
      },
      "properties": {
        "editor": "Shetland Digital Heritage.edtr",
        "fields": [
          {
            "id": "fieldcontain-select-1",
            "val": "Object",
            "label": "What is this?"
          },
          {
            "id": "fieldcontain-image-1",
            "val": null,
            "label": "Can you take a photo?"
          },
          {
            "id": "fieldcontain-audio-1",
            "val": null,
            "label": "Speak about it"
          },
          {
            "id": "fieldcontain-textarea-1",
            "val": "Oh, no",
            "label": "Description"
          },
          {
            "id": "fieldcontain-text-2",
            "val": "me",
            "label": "Shared by:"
          },
          {
            "id": "fieldcontain-text-3",
            "val": "ok",
            "label": "Consent"
          }
        ],
        "timestamp": "2015-09-03T10:16:50.214Z"
      },
      "name": "no image"
    },
    "type": "Shetland Digital Heritage.edtr",
    "isSynced": false,
    "editorGroup": "private"
  }
}
rgamez commented 9 years ago

This issue was fixed in the 1.5 branch: https://github.com/edina/fieldtrip-sync/commit/9f5fcb905e14814df36fa6f5f85cd72f791512e3

but it wasn't included in the release which was using the 0.6.2 tag: https://github.com/edina/fieldtrip-gb/commit/0b851fd76897a3defb1e68b80812ef3e889382cb