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

"Save & Go to Next Form" breaks with 2+ users #68

Open
aanunez opened this issue Jan 9, 2020 · 4 comments · May be fixed by #80
Open

"Save & Go to Next Form" breaks with 2+ users #68

aanunez opened this issue Jan 9, 2020 · 4 comments · May be fixed by #80
Labels

Comments

@aanunez
Copy link
Contributor

aanunez commented Jan 9, 2020

Howdy,

I previously submitted this issue to the redcap devs believing it was a core issue, but after experimenting it would seem that the problem stems from your EM's override of the "Save & Go to Next Form" button. When two users have created a new record and are entering data in the first instrument (i.e. both have Record 1 assigned to them) the one who hits "Save & Go to Next Form" first is, of course, correctly taken to Form 2 for Record 1. However, when the second person hits "Save & Go to Next Form" they too are taken to From 2 for Record 1.

Previous submission (redcap login of course):
https://community.projectredcap.org/questions/76216/record-id-not-updated-when-using-save-and-go-to-ne.html

I haven't been able to look over the code and suggest a fix.

Version 3.3.10
Redcap 9.5.3

@aanunez aanunez closed this as completed Mar 2, 2020
@pbchase
Copy link
Contributor

pbchase commented Mar 20, 2020

@aanunez, what's up with this issue. Did you find a fix?

@aanunez
Copy link
Contributor Author

aanunez commented Mar 20, 2020

It looks like I closed this by mistake as I know this was a real issue. Re-opening. So the issue happens because we assume that the $record passed into loadFRSL is our assigned recordID, but it might not be. We can check to see if the record really exists with

$existingRecord = !empty( REDCap::getData( $Proj->project_id ,"array", $record, REDCap::getRecordIdField() ) ) (maybe there is a better way to do this?)

and pass it down to the js, but I'm not sure what action is best if its non-existent record.

@aanunez aanunez reopened this Mar 20, 2020
@pbchase
Copy link
Contributor

pbchase commented Apr 24, 2020

@aanunez, want to submit a PR?

NikNakk added a commit to NikNakk/form_render_skip_logic that referenced this issue Aug 11, 2020
Makes use of auto parameter when redirecting which instructs REDCap
to replace the id with the correct one
@NikNakk
Copy link

NikNakk commented Aug 11, 2020

I think I've fixed the issue by using the 'auto' parameter during the redirect (see commit above). I've just tested it briefly and it seems to work. Note this problem can be triggered by a single user creating two records at once; it doesn't need a second user to be involved.

I've committed this to a branch that should also fix #57, but I've actually fixed the two issues independently of each other. The commit referenced above is specific to this issue.

@NikNakk NikNakk linked a pull request Aug 11, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants