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

"hidden item" error when opening a form #26

Open
malcjackson opened this issue Nov 6, 2023 · 8 comments
Open

"hidden item" error when opening a form #26

malcjackson opened this issue Nov 6, 2023 · 8 comments
Assignees
Milestone

Comments

@malcjackson
Copy link

malcjackson commented Nov 6, 2023

Describe the bug
After entering data in a form in OC, reopening it results in an inappropriate "hidden item" error

To Reproduce
Add the attached form to a study
Enter data and close the form
Reopen the form in the attached instance in endpoint /edit/fs/dn/i/
Issue720Instance.txt

Expected: The form reopens with no warnings or errors
Actual: The attached "the item you are trying to edit is hidden" error appears

Screenshots
image

Browser and OS (please complete the following information):

Windows, Chrome

Xform of the affected form:
xform_contactdata_hiddenerror.txt

@pbowen-oc pbowen-oc added this to the Next milestone Nov 8, 2023
@malcjackson
Copy link
Author

Updated with additional details on instance and endpoint used in this case

@MartijnR
Copy link
Member

MartijnR commented Nov 15, 2023

curl --user enketorules: -d "server_url=http://localhost:3000&form_id=xform_contactdata_hiddenerror&ecid=1&instance=\
<data xmlns:oc=\"http://openclinica.org/xforms\"  xmlns:enk=\"http://enketo.org/xforms\" ><diagnosis>None</diagnosis><middle>a</middle><street1>b</street1><street2>c</street2><country>d</country><city>e</city><state>f</state><pcode>g</pcode><fdob>h</fdob><hnumber>i</hnumber><meta><instanceID>uuid:1234</instanceID><instanceID_comment></instanceID_comment></meta><street2_comment></street2_comment><city_comment></city_comment><state_comment></state_comment><diagnosis_comment>{\"queries\":[],\"logs\":[{\"type\":\"audit\",\"message\":\"Value changed from \\\"\\\" to \\\"None\\\"\",\"user\":\"siteuser1\",\"date_time\":\"2023-11-06 21:18:03.814 Z\"}]}</diagnosis_comment><street1_comment></street1_comment><fdob_comment></fdob_comment><hnumber_comment></hnumber_comment><pcode_comment></pcode_comment><country_comment></country_comment><middle_comment></middle_comment></data>\
&instance_id=a" http://localhost:8005/oc/api/v1/instance/note/

Findings

Enketo scrolls to the first non-readonly question, which in this case is a non-relevant dn. Not sure if this is a regression or an unusual case.

To Do

  • don't add goTo error handlers if URL has no fragment identifier? (why are they added?)

@pbowen-oc
Copy link

@MartijnR - If we don't pass in a URL parameter identifying a specific item to open to, the expectation is that it simply opens to the top of page 1. If it is doing something different, I think there has been a regression.

@MartijnR
Copy link
Member

MartijnR commented Nov 15, 2023

Thanks! Yes, I confirmed now that it is a regression in Enketo Core 7.2.3 (May 2023) enketo/enketo-core#969

Thankfully, it looks like the fix in my PR restores the original behavior though the goto functionality would require special attention during testing.

@pbowen-oc
Copy link

pbowen-oc commented Nov 29, 2023

@MartijnR - This is not working. We are still seeing the error. We also noticed that it is skipping the first page of a form when it only contains a note and going right to page to with input fields (no relevant logic in use and no goto item in use).

Using /single/fs/i/ the following form opened directly to the second page unexpectedly:
multi-level_crf_v1-sm-v2.xform.txt

@MartijnR
Copy link
Member

MartijnR commented Nov 29, 2023

If you are still seeing the error, I would expect there to be a hash (#) part in the URL (which would mean OC requested the goto functionality). Could you post an Enketo URL please?

Wrt loading the second page, I'll try to reproduce.

@pbowen-oc
Copy link

We are not seeing the error anymore. Our deployment was outdated. However, the issue with page 1 being skipped is still occurring.

@MartijnR
Copy link
Member

The bug is present in any form whose discrepancy notes start on a page other than the first page. The form will load to that page.

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

No branches or pull requests

4 participants