iOS Collector Crash with integer Default Values wrapped in quotes....

984
5
09-27-2016 03:23 PM
AaronCraig2
Occasional Contributor

Hi,

Just wanting ESRI to know that when setting default numerical values on integer fields using the template editor on a webmap, or by adding a new integer field with a default value it wraps the value in quotes in the rest admin URL. This causes Collector for ArcGIS to crash on iOS devices when attempting to change the default integer value to something else.

edited for more info:

The crash seems to only affect integer fields with default values. Any time a default value is added to an integer field, the default value is stored in the Feature service rest admin url wrapped in quotes. The quotes do not show up anywhere, much like how it behaves if you have text field with default values. If that text field had the quotes removed from it's default value in the rest url admin-update definition, it does cause instability and crashes. The problem here is reversed with integers.

Doubles seem to work regardless of their default value being wrapped in quotes or not in the rest url. And text, well since their defaults are wrapped in quotes, as it should be, there is no problem. Only seems to be integer related.

The problem only affects collector on iOS devices (iPhone 6 and iPad are affected), it is not a problem on Android or on PC web maps. Have not tested on Win10 devices or PC web apps.

Reproducing the crash conditions method 1:
  1. Publish a basic feature service (no template/defaults setup)
  2. Add the new feature service layer to a new web map in ArcGIS online
  3. Click table
  4. Click Table Options
  5. Click add field
  6. Add a integer field with a default numerical value of 1
  7. Save your map as Crash test 1

Reproducing the crash conditions method 2:

  1. Publish a basic feature service with an integer field (no template/defaults setup)
  2. Add the new feature service layer to a new web map
  3. Click edit
  4. Click Manage
  5. Click properties on the layer
  6. Add a default numerical value of 1 to the integer field
  7. Click done
  8. Click Save Changes
  9. Save your map as Crash test 2

Reproducing the crash:
  1. Open up collector on a iOS device
  2. Open Crash test 1 map
  3. Add new feature
  4. Attempt to change the integer field that has default value
  5. Crash occurs once the field is tapped
  6. Repeat for Crash test 2 map

Solution for meantime:
  1. Go to your feature service layer's admin rest URL
  2. Click Update Definition
  3. Set Last Edit date to double quotes ""
  4. Scroll down and find the template for new features near the bottom
  5. Find your integer field with the default value
  6. Remove the quotes wrapped around the default numerical value
  7. Click Update layer definition
  8. Now when adding a new feature and changing the default integer field on either Crash test 1 or Crash test 2 maps on a iOS device, the problem is no more.
5 Replies
MiaogengZhang
Esri Regular Contributor

Aaron, 

Which OS platform do you run into this issue? When you say "setting default numerical values using the template editor on a webmap", can you elaborate more details? 

-Morgan

0 Kudos
AaronCraig2
Occasional Contributor

Hi Morgan,

Collector for iOS.

I mean by using the webmap -> Edit -> Mange -> templates. So if I add a default numerical value to a integer/double field type and save the template (thereby updating the feature service layer), in the rest URL for the feature service layer it shows that numerical value wrapped in quotes. In Collector for iOS, this causes a crash when adding a new feature.

0 Kudos
MiaogengZhang
Esri Regular Contributor

I added a double field with default value but I still can't reproduce it. Can you share your map/service to a group and invite the account Collector4ArcGIS into it? 

Here is part of JSON of feature service 

      "prototype" : {         "attributes" : {           "Status" : null,            "Note" : null,            "TestDouble" : "11.1"         }       }
0 Kudos
AaronCraig2
Occasional Contributor

Hi Morgan,

After more testing, the problem does not occur with doubles. Only with integers and iOS devices. I have updated the original post with more information and step by step crash reproduction.

Thanks,

Aaron

0 Kudos
AaronCraig2
Occasional Contributor
Hi Morgan, 

Just like to add, that it seems now that using the method 2 crash condition reproduction, handles integers in the proper way. No quotes are wrapped around integer default values by using this method. 

And by applying this method to the  integer field created in method 1, it does fix the problem.
0 Kudos