vanderbilt-redcap / auto-dags-module

REDCap External Module that automatically creates, renames, and assigns records to DAGs based on a specified field.
MIT License
5 stars 7 forks source link

AutoDAG V1.1.0 Crashes when 'Set DAG for all records' is intiated #4

Closed jasonlones closed 6 years ago

jasonlones commented 6 years ago

REDCap version 8.5.11

REDCap crashed due to an unexpected PHP fatal error!

Error message: Uncaught ArgumentCountError: Too few arguments to function Vanderbilt\AutoDAGsExternalModule\AutoDAGsExternalModule::redcap_save_record(), 2 passed in /var/www/html/redcap/modules/auto_dags_v1.1.0/set-all-dags.php on line 34 and exactly 8 expected in /var/www/html/redcap/modules/auto_dags_v1.1.0/AutoDAGsExternalModule.php:11 Stack trace: #0 /var/www/html/redcap/modules/auto_dags_v1.1.0/set-all-dags.php(34): Vanderbilt\AutoDAGsExternalModule\AutoDAGsExternalModule->redcap_save_record('169', 1) #1 /var/www/html/redcap/redcap_v8.5.11/ExternalModules/index.php(85): require_once('/var/www/html/r...') #2 {main} thrown File: /var/www/html/redcap/modules/auto_dags_v1.1.0/AutoDAGsExternalModule.php Line: 11

mmcev106 commented 6 years ago

@jasonlones, do you happen to have any more information about how this occurred (perhaps steps to reproduce it)? At the moment I'm at a loss as to how redcap_save_record() could get called without all it's arguments.

jasonlones commented 6 years ago

@mmcev106, Created a scenario where a record was created prior to enabling the module, including completing the DAG generating field. Enabled the module. Clicked the 'Set DAG for all records' link which opens the page with the button. Clicked the 'Set DAG for all records' button. Receive the confirmation request (Are you sure you want to...). Clicked 'OK'. Error message. DAG not assigned.

mmcev106 commented 6 years ago

@jasonlones, I was not able to reproduce this, but I believe it's because we're running PHP 5.6 and this exception was added in PHP 7. I just submitted version 1.1.1 to the repo, which I suspect will solve this. Please let me know if it does. Thanks!

jasonlones commented 6 years ago

@mmcev106, thanks Mark. I'll be looking for it.

jasonlones commented 6 years ago

@mmcev106, enabled it last week. Works great for us. Thanks!