OpenClinica / enketo-oc

OpenClinica's fork of the Enketo web forms monorepo
Apache License 2.0
0 stars 1 forks source link

View Query Within Record displays error message when query is part of or in the row after a deleted repeating group row #15

Open eprager412 opened 5 months ago

eprager412 commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce 1: Open attached form in mode /single/fs/ repeatgroup_query_xml.txt with 3 repeat groups.

  1. Add data to each item1 in repeats 1,2,and 3. 3: Add a query to item1 in both repeat 2 and 3 4: Remove repeat 2 5: Access query within record for item1 in repeat 3 based on query url

Expected: url will direct the user to the query for item1 but it is now the 2nd repeat in the UI. Actual: url does not direct the user to the query and displays an error message "The item you are trying to access has been removed from this form. Please use the View Query Only icon instead of the View Query Within Record icon to see it."

Browser and OS (please complete the following information):

Screenshots: 2024-01-29_14-24-13_image0 2024-01-29_14-22-17_image1

2024-01-29_14-23-12_image2

pbowen-oc commented 5 months ago

We are likely currently just passing XPath like: /path/to/repeat[2]/node

A solution would be to pass in XPath that refers to the ordinal attribute we are looking for like: /path/to/repeat[@enk:ordinal="2"]/node

pbowen-oc commented 5 months ago

This will be handled directly on the OC side.