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

Indexed repeat with incorrect number of parameters #60

Closed
joeflack4 opened this issue Nov 29, 2018 · 2 comments
Closed

Indexed repeat with incorrect number of parameters #60

joeflack4 opened this issue Nov 29, 2018 · 2 comments

Comments

@joeflack4
Copy link

joeflack4 commented Nov 29, 2018

Problem description

An issue in which indexed-repeat() is used without the correct number of parameters (i.e. odd numbers >= 3) is not caught and does not produce an error message.

Steps to reproduce the problem

Try to upload the following form: ET-CRVS-KAP-Questionnaire-v4-jef.xlsx to XLSForm Online. It should produce an error message, but doesn't. Instead, an error appears when loading in Enketo afterwards.

Expected behavior

The error is caught and an error message is presented.

Other information

The following message appears after converting using XLSForm online and loading in Enketo:

FormLogicError: indexed repeat with incorrect number of parameters found: indexed-repeat( /ET-CRVS-KAP-Questionnaire-v4-jef/child_u6/PCGfirstname_lab , /ET-CRVS-KAP-Questionnaire-v4-jef/child_u6 , /ET-CRVS-KAP-Questionnaire-v4-jef/random_Index ,1)

This should not happen in Enketo, but should happen at the time that ODK Validate (or PyXform) is run.

Also filed at PyXform: XLSForm/pyxform#243

@lognaturel
Copy link
Member

The full expression is if((${list_eligibleCG_Index} != ''), indexed-repeat(${PCGfirstname_lab} ,${child_u6},${random_Index},1),''). This is not identified as problematic by Validate because Validate doesn't actually do a syntax check, it runs through the form as a client would but without filling out any values. That means it doesn't hit the if path with the problematic indexed-repeat call.

I bet this is exactly what's going on with getodk/javarosa#480 (comment) -- it's probably a nested if that has the problem.

I just added a commit to #78 to at least explain this behavior. I'll need to keep thinking about what we can/should do about the broader issue and have filed getodk/javarosa#481 since it will need to be addressed in JavaRosa.

@joeflack4
Copy link
Author

joeflack4 commented Sep 6, 2019

Ahhhh, I see. Yes, getodk/javarosa#481 looks like the super fix to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants