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

db-object-widget not re-triggered when field becomes relevant #8653

Open
jkuester opened this issue Oct 19, 2023 · 2 comments
Open

db-object-widget not re-triggered when field becomes relevant #8653

jkuester opened this issue Oct 19, 2023 · 2 comments
Labels
Enketo Affects Enketo forms Type: Bug Fix something that isn't working as intended

Comments

@jkuester
Copy link
Contributor

Describe the bug
A select-contact field can be pre-populated by setting its calculation value to the Id of a contact to load. However, when the field is non-relevant, no data is loaded for the contact. Then, if the field does become relevant later, the db-object-widget code does not get triggered and so no data gets loaded.

To Reproduce
Use a select-contact field in a group to load data for a pre-populated contact id. If the group is relevant when the form loads, then the data for the contact is loaded as expected. However, if the group is non-relevant when the form loads and then later becomes relevant, no data will be loaded for the contact (and the contact's name will not be shown in the question widget).

Expected behavior
When a select-contact field becomes relevant, it should evaluate the db-object-widget logic when there is a pre-populated id value.

Environment
Happening on master (4.4.1+) and on 3.9.0.

Additional context

Note that a non-relevant select-contact field that becomes relevant behaves just fine when the value is selected by the user. It is just the case where the value is pre-populated that results in the logic not getting triggered.

This issue seems related to #8225, but is not exactly the same since it is not specific to inputs.

Originally reported on the forum.

@garethbowen
Copy link
Member

Removed the "affects" labels as the bug isn't a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enketo Affects Enketo forms Type: Bug Fix something that isn't working as intended
Projects
Status: Todo
Development

No branches or pull requests

5 participants