Skip to content

Catch missing configuration row for external choices#6794

Merged
grzesiek2010 merged 5 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6792
Nov 20, 2025
Merged

Catch missing configuration row for external choices#6794
grzesiek2010 merged 5 commits intogetodk:masterfrom
grzesiek2010:COLLECT-6792

Conversation

@grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jul 4, 2025

Closes #6792

Why is this the best possible solution? Were any other approaches considered?

The issue was that the populateExternalChoices method, which is responsible for reading from external CSV files, returned internal choices if they existed for values represented as integers: 08fcc82#diff-5dca0a8d3dc453ec1b67830005c61a9c5a3e4d845c06181cff53506e36c3680dL175
However, this method should always read from the CSV file, as that is its intended purpose.

I'm not really sure why it was implemented in this way.

It turned out that tearting numeric choices in a different way is a feature - see comments in #6792.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Playing with forms that read choices from external files is what we need to test here to make sure there is no regression introduced.

Do we need any specific form for testing your changes? If so, please attach one.

I've used: dynamic_and_static_choices.xlsx

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review July 4, 2025 20:58
@grzesiek2010 grzesiek2010 changed the title Always try to read external file when trying to fetch external choices Fixed #populateExternalChoices to always read choices from external files Jul 4, 2025
@grzesiek2010 grzesiek2010 requested a review from seadowg July 4, 2025 20:59
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some details about how I think we should address this at #6792 (comment)

@seadowg seadowg removed their request for review August 25, 2025 08:53
@grzesiek2010 grzesiek2010 changed the title Fixed #populateExternalChoices to always read choices from external files Catch missing configuration row for external choices Sep 26, 2025
Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of changes requested inline!

@dbemke
Copy link

dbemke commented Nov 19, 2025

The apk has been removed. Could you run the build again?

@grzesiek2010
Copy link
Member Author

It should be there now.

@dbemke
Copy link

dbemke commented Nov 20, 2025

Tested with Success!

Verified on Android 10

Verified cases:

@WKobus
Copy link

WKobus commented Nov 20, 2025

Tested with success

Verified on Android 16

@grzesiek2010 grzesiek2010 merged commit 60d58ed into getodk:master Nov 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing external CSV should consistently prevent question use regardless of choice type

4 participants