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

The "itext-demo" demo form fails to load #6706

Closed
dianabarsan opened this issue Nov 2, 2020 · 5 comments
Closed

The "itext-demo" demo form fails to load #6706

dianabarsan opened this issue Nov 2, 2020 · 5 comments
Labels
Enketo Affects Enketo forms Type: Technical issue Improve something that users won't notice

Comments

@dianabarsan
Copy link
Member

dianabarsan commented Nov 2, 2020

Describe the issue
This form: https://github.com/medic/support-scripts/blob/54b180613060ce73505bb163886c52f688f47931/forms/itext-demo.xml
fails on 3.10 with

Error loading form. Error: ["FormLogicError: Could not evaluate: jr:itext('/issue-3870/group_note/default_chw_sms/anc_only_home_sba_birth:label'), message: Failed to execute 'evaluate' on 'Document': The string 'jr:itext(\"/issue-3870/group_note/default_chw_sms/anc_only_home_sba_birth:label\")' is not a valid XPath expression."]

Describe the improvement you'd like
Determine whether this form has ever worked.
If it has, it means we've regressed at some point. In this case, create a new issue to fix the regression.
If it's bugged in some minor way, fix it.
If it's never worked and we're not supposed to support it, remove it from the demo-forms folder.

For reference,

@dianabarsan dianabarsan added the Type: Technical issue Improve something that users won't notice label Nov 2, 2020
@dianabarsan
Copy link
Member Author

Further testing shows that another demo form (https://github.com/medic/cht-core/blob/master/demo-forms/itext-in-calculate.xml) fails with another error, and looks like it's related:

Error loading form. Error: ["FormLogicError: Could not evaluate: jr:itext('/test/one'), message: Failed to execute 'evaluate' on 'Document': The string 'jr:itext(\"/test/one\")' is not a valid XPath expression."]

@MaxDiz
Copy link
Contributor

MaxDiz commented Nov 3, 2020

@dianabarsan sounds like it should be treated as a regression and scheduled in the next release (or after Angular update is merged in 3.11). Agree?

@dianabarsan
Copy link
Member Author

dianabarsan commented Nov 3, 2020

It's unclear if the regression is in CHT-Core or Enketo, and I think it probably happened many versions ago.
I've found other possible regressions (but not as dramatic as this one) in demo forms.

I made a note to go over all of them once the Angular migration is done.

Because we've scheduled the Enketo upgrade for next version (3.12), I'm tempted to push these until after we do the upgrade, as it might fix these issues by itself. The issue requires more investigation, anyway.

@MaxDiz MaxDiz added the Status: Blocked waiting for info Blocked waiting for more information label Nov 3, 2020
@dianabarsan
Copy link
Member Author

I randomly bumped into this. Adding the Enketo tag for investigation, @jkuester .

@dianabarsan dianabarsan added the Enketo Affects Enketo forms label Jan 29, 2022
@jkuester
Copy link
Contributor

TLDR: I am planning to address this issue by removing the broken test forms as a part of the Enketo uplift changes here: https://github.com/medic/support-scripts/pull/7


I have verified this still does not work on the updated Enketo version in 6345-enketo-uplift. I also tested against 3.4.0 and also got the same issue. After doing a bunch of reading, I am pretty sure that using jr:itext as an xPath function in a calculate never worked with Enketo. As Alex noted in his comment on this issue linked above, the itext data is unpacked during the xsl transformation of the form xml and is not implemented in such a way that it could be used used dynamically.

It is also worth noting that jr:itext is one of the ODK xPath functions that openrosa-xpath-evaluator explicitly notes is not implemented.

These itext test forms were added here in a commit that added a bunch of test forms. I am not sure exactly where Alex got those forms, but my guess is at least some of them were for testing ODK Collect (where using jr:itext as an xPath function in a calculate seems to work, presumably because they have implemented this in javarosa...).

Context:

@jkuester jkuester removed the Status: Blocked waiting for info Blocked waiting for more information label Apr 13, 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: Technical issue Improve something that users won't notice
Projects
None yet
Development

No branches or pull requests

3 participants