enketo-core
enketo-core copied to clipboard
[Nested repeats] all the child questions in new repeat instance are not auto generated when this repeat is the grand grand son of a root repeat after specified steps
Describe the bug All the child questions in new repeat instance are not auto generated when this repeat is the grand grand son of a root repeat after specified steps.
To Reproduce
- Create a xls form, add a repeat question(repeat A).
- Add a text question and a repeat question(repeat B) into
repeat A. - Add a text question and a repeat question(repeat C) into
repeat B. - Add a text question and a repeat question(repeat D) into
repeat C. Add a text question into repeat D, set a constraint expression for this text question(eg:string-length(.)<=10). - Publish the survey, open it in enketo app. By default, the first instance of repeat A is existing.
- Click the add(
+) button of repeat B or repeat C. Observe, the new repeat instance generated correctly. - Click the add(
+) button of repeat A, Observe, in the new repeat instance, the repeat D is not generated. - Click the add(
+) button of repeat D to add a instance manually, - Validate the form, an error occurs, it says:
Form contains errors. Please see fields marked in red..
Expected behavior
- In the step 7, default instance of repeat D can be generated automatically.
- The validation of step 9 works normally.
Screenshots and attachments xls form:
issues on nested repeat when the repeats level is greate than 3.xlsx

enketo app:

After step 7, the repeat D instance is not generated in the model:

Error info:

Thanks @nanzhang01,
Excellent issue report. I won't be working on nested repeat issues myself, but a PR is welcome.
might be duplicate of #804