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

Broken functions for xForm repeat_groups #7237

Closed
jkuester opened this issue Aug 6, 2021 · 2 comments · Fixed by #7256
Closed

Broken functions for xForm repeat_groups #7237

jkuester opened this issue Aug 6, 2021 · 2 comments · Fixed by #7256
Assignees
Labels
Enketo Affects Enketo forms Type: Bug Fix something that isn't working as intended
Milestone

Comments

@jkuester
Copy link
Contributor

jkuester commented Aug 6, 2021

Describe the bug
Currently there are several functions (at least count() and position()) that are required when doing any kind of advanced logic in a repeat_group which do not seem to function at all within the CHT. When any of these functions are included in a form they cause errors to be thrown when the CHT tries to display the form.

Example Error Log
inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3 Error loading form Error: ["FormLogicError: Could not evaluate: count( /model/instance[1]/test_form/plant ), message: Failed to execute 'evaluate' on 'Document': Type conversion failed while evaluating the expression."]
    at inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3
    at inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3
    at inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3
    at c.$digest (inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3)
    at inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3
    at Object.completeTask (inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3)
    at inbox.js?_sw-precache=5ec5cb99da4ab03e3fd1d06910e2f057:3

Not having this functionality prevents CHT forms from being able to do things like repeating as long as a condition is met.

To Reproduce

I have created a test form that illustrates the desired behaviors: test_form.xlsx

This form works fine when previewed in https://getodk.org/xlsform/ but does not function when loaded in the CHT.

Additional context

These issues might be (at least partially) related to the older version of enketo-core that is currently used by the CHT. This issue should be revisited after the enketo-core upgrade is completed for #6345.

@jkuester jkuester added Type: Bug Fix something that isn't working as intended Enketo Affects Enketo forms labels Aug 6, 2021
@jkuester
Copy link
Contributor Author

jkuester commented Aug 9, 2021

Additional context from the forum: https://forum.communityhealthtoolkit.org/t/displaying-dynamic-screens/1085/3

@jkuester jkuester added this to the 3.14.0 milestone Jan 12, 2022
@jkuester jkuester added this to Ready for dev in Allies Workstream - DEPRECATED via automation Jan 12, 2022
@jkuester jkuester moved this from Ready for dev to Ready for AT in Allies Workstream - DEPRECATED Jan 12, 2022
@lorerod lorerod self-assigned this Jan 13, 2022
@lorerod lorerod moved this from Ready for AT to AT in progress in Allies Workstream - DEPRECATED Jan 13, 2022
@lorerod
Copy link
Contributor

lorerod commented Jan 14, 2022

Reproducible on Master

  • Tested with the form provided. Error is thrown when the CHT tries to display the form.
Error Log
main.js?_sw-precache=2ff7a4dc4fbb91e253d7a732e47edce6:1 Error loading form. Error: ["FormLogicError: Could not evaluate: count( /model/instance[1]/test_repeat/plant ), message: Failed to execute 'evaluate' on 'Document': Type conversion failed while evaluating the expression."]
    at main.js?_sw-precache=2ff7a4dc4fbb91e253d7a732e47edce6:1:2968191
    at p.value (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:10189)
    at p.value (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:4280)
    at polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:21025
    at p.value (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:10880)
    at p.value (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:5076)
    at f (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:13186)
    at p.value [as invoke] (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:12865)
    at g (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:24995)
    at FileReader.w (polyfills.js?_sw-precache=2cd50933bd1e83dcdc75f254671e4a26:1:25227)

Fixed on branch

@lorerod lorerod moved this from AT in progress to Ready to merge in Allies Workstream - DEPRECATED Jan 14, 2022
@dianabarsan dianabarsan modified the milestones: 3.14.0, 4.0.0 Jan 26, 2022
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: Done
Development

Successfully merging a pull request may close this issue.

3 participants