Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open choice missing string value #2520

Open
FikriMilano opened this issue Apr 23, 2024 · 5 comments · May be fixed by #2521
Open

Open choice missing string value #2520

FikriMilano opened this issue Apr 23, 2024 · 5 comments · May be fixed by #2521
Labels
effort:small Small effort - 2 days P1 High priority issue

Comments

@FikriMilano
Copy link
Collaborator

Describe the bug
There's a missing value when the user taps "Add another answer" but did not fill in the text box, then save the choices.

After submitting a Questionnaire Response with that missing value, then opening the Questionnaire again together with that Questionnaire Response, the app crashed with NPE of that missing value, which should not be missing.

Component
SDC library

To Reproduce
Steps to reproduce the behavior:

  1. Tap "Open choice" card
  2. Click the open-choice widget
  3. Scroll to bottom
  4. Tap "Other" checkbox
  5. Tap "Add another answer" button
  6. Do not fill in the text box
  7. Tap "Save" button
  8. Tap "Submit" button
  9. See the populated answer, but missing a value

Expected behavior
The answer should not be populated if the value is missing

Recording

Screen.Recording.2024-04-23.at.08.35.44.mov

Smartphone (please complete the following information):

  • Device: [e.g. Pixel4a emulator]
  • Android version: [e.g. Settings -> About phone -> Android version]
  • Build number: [e.g. Settings -> About phone -> Build number]
  • Version [e.g. 22]

Additional context
N/A

Would you like to work on the issue?
Yes

@FikriMilano FikriMilano linked a pull request Apr 23, 2024 that will close this issue
7 tasks
@FikriMilano
Copy link
Collaborator Author

@pld @f-odhiambo

@santosh-pingle
Copy link
Collaborator

@FikriMilano Is it happening with other widgets too?

@santosh-pingle santosh-pingle added P1 High priority issue effort:small Small effort - 2 days labels Apr 24, 2024
@FikriMilano
Copy link
Collaborator Author

@santosh-pingle it's a very specific use case, only happens in this widget

@FikriMilano
Copy link
Collaborator Author

Let me clarify.
The Answer object is saved to the QR item, but the Answer's value is missing

@FikriMilano
Copy link
Collaborator Author

See JSON below, note: the nested item is an flyover text.

{
  "linkId": "4a1c4c0d-158f-494c-a33f-1f7f8e41f21f",
  "answer": [
    {
      "valueCoding": {
        "code": "isolation",
        "display": "Isolation"
      },
      "item": [
        {
          "linkId": "d2a44529-9344-4ec1-ac7a-10dddbf27467",
          "text": "Behaviors"
        }
      ]
    },
    {
      "item": [
        {
          "linkId": "d2a44529-9344-4ec1-ac7a-10dddbf27467",
          "text": "Behaviors"
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:small Small effort - 2 days P1 High priority issue
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

2 participants