susom / redcap-em-shazam

Shazam External Module
MIT License
18 stars 11 forks source link

Unexpected fatal error on PHP8 with non-superusers #48

Closed tertek closed 1 year ago

tertek commented 1 year ago

When trying to save new input in the "Shazam Editor", the request with action=save to "/ExternalModules/?prefix=shazam&page=config&pid=81" returns 200 but fails with following error:

REDCap crashed due to an unexpected fatal PHP error!

Error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in modules/shazam_v1.3.10/config.php:247 Stack trace: #0 modules/shazam_v1.3.10/config.php(247): in_array() #1 redcap_v12.4.21/ExternalModules/index.php(126): require('...') #2 {main} thrown
File: modules/shazam_v1.3.10/config.php
Line: 247

This error does not occur when testing with superusers. Could be fixed with PHP8 array casting.

123andy commented 1 year ago

Releasing a patch tonight. Thanks!

tertek commented 1 year ago

@123andy thank you!

123andy commented 1 year ago

I had to submit a second time to address some Psalm issues but resubmitted again.

-a


From: Ekin Tertemiz @.> Sent: Tuesday, November 29, 2022 11:23 PM To: susom/redcap-em-shazam @.> Cc: Andy Martin @.>; Mention @.> Subject: Re: [susom/redcap-em-shazam] Unexpected fatal error on PHP8 with non-superusers (Issue #48)

@123andyhttps://github.com/123andy thank you!

— Reply to this email directly, view it on GitHubhttps://github.com/susom/redcap-em-shazam/issues/48#issuecomment-1331740810, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABY5VMLTXT3CK5PWPIKT6I3WK36GJANCNFSM6AAAAAASLDTQBI. You are receiving this because you were mentioned.Message ID: @.***>

tertek commented 1 year ago

Okay thx