getodk / collect

ODK Collect is an Android app for filling out forms. It's been used to collect billions of data points in challenging environments around the world. Contribute and make the world a better place! ✨📋✨
https://docs.getodk.org/collect-intro
Other
719 stars 1.38k forks source link

Filled values in a required question in Trees Create or Update form get removed #6533

Open dbemke opened 3 days ago

dbemke commented 3 days ago

ODK Collect version

the store version 2024.3.2 ,the master version f0ce2a68fd6cbbf797890359980879bc0b45344e

Android version

10, 14

Device used

Redmi 9T, Pixel 7a

Problem description

Filled values in a required question (new circumference) in Trees Create or Update form get removed after tapping "check for errors” or trying to send the form. It seems that it happens when the circumference field was left empty in registration form.

https://github.com/user-attachments/assets/a375dddc-7962-4668-946c-c03511d01238

Steps to reproduce the problem

  1. Download user "createORupdate” https://staging.getodk.cloud/#/projects/101/app-users.
  2. Go to trees registration space1 form and create an entity with species but WITHOUT any value in circumference.
  3. Go to Trees Create or Update form and select the created entity.
  4. Swipe to following questions (don’t change prefilled choices/selects), in "new circumference” enter a number.
  5. Tap the three dots -check for errors or try to send the form (the filled "new circumference is removed – there’s information that the response is required)

    Expected behavior

    Filled values shouldn't disappear

    Other information

    I tried to reproduce it in Trees update form but the issue doesn't occur.

seadowg commented 3 days ago

I think this is a mistake in the form right? new_circumference ("New circumference") has is bound with a calculate on the current circumference of the selected tree being updated so when "Check for errors" happens it'll get calculated again. Unless I'm mistaken, this form should be using trigger (https://docs.getodk.org/form-logic/#dynamic-defaults-from-form-data).