diff --git a/src/js/relevant.js b/src/js/relevant.js index 971d9ceb2..58aece651 100644 --- a/src/js/relevant.js +++ b/src/js/relevant.js @@ -87,8 +87,9 @@ export default { * but currently has 0 repeats, the context will not be available. This same logic is applied in output.js. */ let context = p.path; - if ( getChild( node, `.or-repeat-info[data-name="${p.path}"]` ) && !getChild( node, `.or-repeat[name="${p.path}"]` ) ) { - context = null; + const repeatInfo = getChild( node, `.or-repeat-info[data-name="${p.path}"]` ); + if ( repeatInfo != null && !getChild( node, `.or-repeat[name="${p.path}"]` ) ) { + this.form.repeats.add( repeatInfo ); } /* diff --git a/test/forms/core-804-nested-repeat-relevant.xml b/test/forms/core-804-nested-repeat-relevant.xml new file mode 100644 index 000000000..f022b6c64 --- /dev/null +++ b/test/forms/core-804-nested-repeat-relevant.xml @@ -0,0 +1,158 @@ + + + + enketo-repeat-bug + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yes + + + no + + + + + + + + yes + + + no + + + + + + + + drawing_set + + + maintenance_schedule + + + other + + + + If no file available, go to next question to take a photo + + + + + + + + yes + + + no + + + + + + If available + + + conductivity + + + flow + + + other + + + + + + + + + +