lsgs / redcap-extended-reports

Provides various additional options to enhance REDCap's built-in reporting functionality.
GNU General Public License v3.0
1 stars 4 forks source link

Error: str_replace(): Argument #4 ($count) cannot be passed by reference #3

Closed 274188A closed 1 year ago

274188A commented 1 year ago

Hi Luke,

seeing this thrown when running a report:

[This message was automatically generated by REDCap]

The 'extended_reports' module threw the following exception when calling the hook method 'redcap_every_page_before_render':

Error: str_replace(): Argument #4 ($count) cannot be passed by reference in D:\redcap_prod\modules\extended_reports_v2.0.1\Report.php:1130 Stack trace:

0 D:\redcap_prod\modules\extended_reports_v2.0.1\Report.php(561): MCRI\ExtendedReports\Report->makeCsvValue('...', '...', '...')

1 D:\redcap_prod\modules\extended_reports_v2.0.1\Report.php(445): MCRI\ExtendedReports\Report->doExtendedReport('...', '...', '...', '...')

2 D:\redcap_prod\modules\extended_reports_v2.0.1\ExtendedReports.php(66): MCRI\ExtendedReports\Report->exportReport()

3 D:\redcap_prod\redcap_v13.8.4\ExternalModules\classes\ExternalModules.php(3162): MCRI\ExtendedReports\ExtendedReports->redcap_every_page_before_render('...')

4 D:\redcap_prod\redcap_v13.8.4\ExternalModules\classes\ExternalModules.php(3328): ExternalModules\ExternalModules::startHook('...', '...', Array)

5 D:\redcap_prod\redcap_v13.8.4\ExternalModules\classes\ExternalModules.php(3361): ExternalModules\ExternalModules::ExternalModules{closure}('...', '...')

6 D:\redcap_prod\redcap_v13.8.4\Classes\Hooks.php(41): ExternalModules\ExternalModules::callHook('...', Array)

7 D:\redcap_prod\redcap_v13.8.4\Classes\System.php(923): Hooks::call('...', Array)

8 D:\redcap_prod\redcap_v13.8.4\Config\init_project.php(7): System::initProjectPage()

9 D:\redcap_prod\redcap_v13.8.4\DataExport\data_export_ajax.php(4): require_once('...')

10 {main}

URL: https://redcap.curtin.edu.au/redcap_v13.8.4/DataExport/data_export_ajax.php?pid=436&xml_metadata_options= Server: redcap.curtin.edu.au (RCAPMT01P) User: john Project ID: 436 Module Name: Extended Reports (extended_reports) Module Author(s): luke.stevens@mcri.edu.au Run Time: 2 seconds

lsgs commented 1 year ago

Thanks for the report @274188A. Can you identify a particular field and value that is at the root of this, by any chance? It appears to be occurring as it tries to make a speicifc value for output in your CSV export.

It would be perfect if you could share a project XML or data dictionary for a simplified project/report that illustrates the issue, but if that's not feasible can you perhaps try and identify the trouble-causing:

274188A commented 1 year ago

I cannot now reproduce the bug - will keep an eye on it