uwctri / Recalculate

Redcap External Module to force recalcuations on fields, events, or records
GNU General Public License v3.0
3 stars 1 forks source link

Exception on cron job #5

Closed aanunez closed 6 months ago

aanunez commented 1 year ago

A user reached out via email with the below issue reported by their redcap system. They are currently attempting to reproduce the issue in a minimal viable project. I was unable to do so.

User's system: REDCap 13.4.13 · PHP 8.1.19 (Linux/Unix OS) · MySQL 5.7.33 on 15/05/2023 Unable to replace issue using XML in REDCap 13.7.1 · PHP 8.1.19 (Linux/Unix OS) · MySQL 8.0.33

Cron job 'recalculate_user' failed for External Module 'recalculate'.

Exception: Error: Cannot unset offset in a non-array variable in /var/www/html/redcap_v13.4.13/Classes/DataQuality.php:4678
Stack trace:
#0 /var/www/html/redcap_v13.4.13/Classes/Records.php(6898): DataQuality::dataResolutionAutoDeverify()
#1 /var/www/html/redcap_v13.4.13/Classes/Calculate.php(552): Records::saveData()
#2 /var/www/html/modules/recalculate_v1.3.7/Recalculate.php(316): Calculate::saveCalcFields()
#3 /var/www/html/modules/recalculate_v1.3.7/Recalculate.php(125): UWMadison\Recalculate\Recalculate->recalculate()
#4 /var/www/html/redcap_v13.4.13/ExternalModules/classes/ExternalModules.php(6328): UWMadison\Recalculate\Recalculate->run_cron()
#5 /var/www/html/redcap_v13.4.13/Classes/Cron.php(332): ExternalModules\ExternalModules::callCronMethod()
#6 /var/www/html/redcap_v13.4.13/cron.php(23): Cron->execute()
#7 /var/www/html/cron.php(9): include('...')
#8 {main}
aanunez commented 6 months ago

This issue has not come up again and has now occurred on an out of date version of redcap. Closing.

If this does occur again it is related to $data being empty (possibly?) while using the data resolution workflow.