Open dimitriscing opened 2 years ago
@dimitriscing would you mind providing your Project XML here?
GithubProject_2022-10-17_1736.REDCap.zip
@ChemiKyle Please find my project attached. I have trimmed some sections and left only the ones that throw errors. By making the fields NON required the two first pop-up errors in Medical History go away. The rest do NOT go away even after making the fields NON required. Please follow my example to replicate the errors.
auto_populate_fields is the only EM I have installed.
Thank you for your help and support.
@ChemiKyle We are experiencing similar problems after upgrading REDCap from 10.0.0 to 12.4.3 (and PHP from 6.8 to 7.4). Did you have the time to look into this issue? (or @dimitriscing, did you figure out a solution?)
Hi @januz. Unfortunately I could not come up with a solution so I had to uninstall the module completely.
However since most of the problems in my case occurred whenever a variable changed in a different instrument , I came up with a solution using the native Recap @IF statement + @HIDDEN action tags, in order to remove the annoying pop up message "ERASE THE VALUE OF THE FIELD".
e.g. @IF([projects(2)][current-instance] = '0' , @HIDDEN , @DEFAULT="[variablea:checked:value][previous-instance]" ) -> this prevents the "ERASE THE VALUE OF THE FIELD" pop up in case the checkbox becomes unchecked and a variable connected to it was already filled in a different instrument. Additionally it passes the value from one instance to the next (if your business logic requires so)_ instance in case the checkbox was originally checked and remained untouched.
@dimitriscing Thanks so much for getting back to me and describing your solution!
@ChemiKyle Are there any plans to adapt the module for newer REDCap versions?
@januz @dimitriscing
I was able to recreate this error (thank you very much for the XML); I'm pretty sure I know where to look for the root of the issue (it's in frontend (i.e. JavaScript), so PHP upgrades won't make a difference).
We do run modern (12+) REDCap on our servers so eventually this issue will be addressed, but I don't currently have a timeline.
The second question in the photo above is only shown when the first question is answered “Yes” and the third question is only shown when the second question is “Yes”. The problem occurs when I change the first question to “No” or “Unknown” and I Save the form, then I get this message BRANCHING LOGIC ERRORS EXIST! There is definitely not a syntactical error in the branching logic as it is simple and straightforward.
I am facing similar problems in other instruments in the same project and the branched fields show errors when the original value is changed, and in some other cases they are cleared without any problems after the form is saved.
When I disable the external module the branching logic works okay, showing only the warning “ERASE THE VALUE OF THE FIELD” which is expected.
Interestingly, when I make the second question NON-Required the error message disappears.
Example number 2:
I have a field in the Annual Update General Information Instrument called Projects. Depending on which checkbox is checked in Projects, different fields are shown in other instruments in the same project. I check GenoMed and INHERENT and save Annual Update General Information. Then I go to Medical History and I save the instrument also. The issue occurs when I go back to to Annual Update General Information and uncheck GenoMed and INHERENT and then save the instrument. When I go to Medical History instrument and try to save it I get this error :
However the branching logic errors I receive are completely unrelated to the fields unchecked in the Annual Update General Information. The fields that are supposed to have errors, have their own branching logic but they are NOT connected to the field Projects . I get 25 error messages because of this and the user needs to click OK 25 times for the popup to go away. This happens only on the first Save. After the first save the issue goes away.
I am not sure why it is behaving like this selectively, and in some cases, it works fine and, in some others, I get this error.
I’ve used different browsers with the same results.
REDCap: 12.4.1 · PHP 7.4.3 (Linux/Unix OS) · MySQL 8.0.30 / Auto Populate Fields - v2.6.0