Runtime-Error when calculating a select_one type as integer (KoBoCollect)

Description

If you set pre-set a select_one type per calculation as integer (instead of " " or ’ '), you get a system runtime-error in KoBoCollect. (But everything works fine before and even after.)

Steps to Reproduce

  1. Import and preview the attached example XLSForm Online (ok)
  2. You can also check the form with XForm Online (ok!)
  3. Deploy the form
  4. Fill form in KoBoCollect
  5. See the ERROR message (javarosa) & confirm
    6 Move step-wise to the end of the form, (Attention: If you use GoToEnd you will crash)
  6. Finalise and save the form (ok)
  7. Re-open and see (!) the integer value in the navigation menu (ok)
  8. Send the form and look at the data (ok)

Expected behavior

Same behavior as in Enketo. An automatic cast for the type should be done.

Actual behavior

See example
SelectOne_Integer01.xlsx (10.4 KB)

Additional details

It is working well in Enketo/Preview. And also the data can be stored correctly.
As far as I could see, automatic casts seem to be done at other places for default, in if expressions and in constraints.
If you put hyphens β€œ1” or do an explicit string( 1 ) cast, it’s ok…

1 Like

Hi @wroos,

It seems that if you use the default instead of the the calculation as outlined in the image below the problem should be solved:

image

Reference xlsform:
SelectOne_Integer01.xlsx (11.0 KB)

But I appreciate that the discussions should always be open as it works in Enketo and does not support with ODK Collect as well as KoBoCollect android app.

Maybe @martijnr and @Xiphware could add more to the discussion that would be helpful.

Have a great day!

Good find @wroos! I looked at this and my conclusion is that this is indeed a bug in JavaRosa. It would be much appreciated if you could report it here or let us know if you’d like someone else to do this. Your report is very clear so cutting-and-pasting this into a new GitHub issue is all that is required probably.

1 Like