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

Fix for array_keys(): Argument #1 ($array) must be of type array error #75

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ihabzee
Copy link

@ihabzee ihabzee commented Feb 28, 2024

Error is caused by adding a random instrument name to the page parameter in the URL. I added a check to confirm instrument exists in the project.

The 'imagemap' module threw the following exception when calling the hook method 'redcap_every_page_top':

TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /var/www/html/redcap/modules/imagemap_v1.11.0/ExternalModule.php:55
Stack trace:
#0 /var/www/html/redcap/modules/imagemap_v1.11.0/ExternalModule.php(55): array_keys(NULL)
#1 /var/www/html/redcap/modules/imagemap_v1.11.0/ExternalModule.php(31): ImageMap\ExternalModule\ExternalModule->injectImageMaps()
#2 /var/www/html/redcap/redcap_v14.1.1/ExternalModules/classes/ExternalModules.php(3199): ImageMap\ExternalModule\ExternalModule->redcap_every_page_top('1825')
#3 /var/www/html/redcap/redcap_v14.1.1/ExternalModules/classes/ExternalModules.php(3366): ExternalModules\ExternalModules::startHook('imagemap', 'v1.11.0', Array)
#4 /var/www/html/redcap/redcap_v14.1.1/ExternalModules/classes/ExternalModules.php(3399): ExternalModules\ExternalModules::ExternalModules\{closure}('imagemap', 'v1.11.0')
#5 /var/www/html/redcap/redcap_v14.1.1/Classes/Hooks.php(41): ExternalModules\ExternalModules::callHook('every_page_top', Array)
#6 /var/www/html/redcap/redcap_v14.1.1/Classes/HtmlPage.php(150): Hooks::call('redcap_every_pa...', Array)
#7 /var/www/html/redcap/redcap_v14.1.1/Config/init_functions.php(640): HtmlPage->PrintHeader()
#8 /var/www/html/redcap/redcap_v14.1.1/Libraries/PEAR/Auth.php(587): loginFunction('dsfdsf', -3, Object(Auth))
#9 /var/www/html/redcap/redcap_v14.1.1/Libraries/PEAR/Auth.php(530): Auth->login()
#10 /var/www/html/redcap/redcap_v14.1.1/Classes/Authentication.php(1922): Auth->start()
#11 /var/www/html/redcap/redcap_v14.1.1/Classes/Authentication.php(894): Authentication::checkLogin('', 'table')
#12 /var/www/html/redcap/redcap_v14.1.1/Classes/Authentication.php(647): Authentication::tableBasedLogin()
#13 /var/www/html/redcap/redcap_v14.1.1/Classes/System.php(936): Authentication::authenticate()
#14 /var/www/html/redcap/redcap_v14.1.1/Config/init_project.php(7): System::initProjectPage()
#15 /var/www/html/redcap/redcap_v14.1.1/DataEntry/index.php(6): require_once('/var/www/html/r...')
#16 {main}

@ChemiKyle ChemiKyle self-requested a review March 4, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant