Open tertek opened 1 month ago
Could you please explain what you mean by "using the action tag field" ?
Also please report your PHP version.
Hello, David here, I will provide as much as I can:
PHP 8.1.3 (Windows OS)
This field when clicking on the button shows the original error:
685 | [gp_letter_inject] | Gp Letter Injection Test | descriptiveField Annotation: @PDFI='260472' -- | -- | -- | --Clicking on the thumbnail below does not do anything:
I have cloned the project and the cloned version works fine, with all pdf injections running, but in the original project (which was created 2023-11-28) it does not work.
Hi @BHDIdata The error is referring to line 314 where user permissions are being checked: https://github.com/Research-IT-Swiss-TPH/redcap-pdf-injector/blob/6a249ba24afeb9cc1ad271bfa3721f1455ce4d0c/pdfInjector.php#L312-L314
Could you please compare the user's rights that you encounter the error with, and report back if there is anything different regarding access on that specific project and form?
It is a bug for sure! Thanks :)
@BHDIdata The second issue with the thumbnail seems to be a problem in JavaScript. Could you please open the Developer Tools of your browser and check if there are any red messages (errors?)
Please also ensure, that in Module settings the option "Debug" is enabled.
Ahh interesting, I realised that my admin account was not actually added to the permissions of the project, since as an admin I rarely need to be. Adding my admin account to the project with permissions has allowed me to access the injected pdf using the action tag button inside the instrument.
However, the javascript button and thumbnail still do not activate
I've refreshed the page and opened the console, this error appears when clicking the button:
record_home.php?pid=1093&arm=1&id=ELF_001:128
Uncaught ReferenceError: ELF_001 is not defined
at HTMLAnchorElement.onclick (record_home.php?pid=1093&arm=1&id=ELF_001:128:220)
In this project, "ELF_001" is the name of the first record, implemented by a module "Custom Record Auto-numbering - v1.0.6" by Luke Stevens (Murdoch Children's Research Institute) The cloned project does not have this, as I had not thought it necessary for testing, but perhaps that is the cause.
Issue reported by user on REDCap Community:
"I've encountered an error with the module I was hoping you could help with.
The issue occurs when trying to open the injected PDF using the action tag field. Also, when trying to open the pdf from the record home page nothing happens.
REDCap Version 14.0.33 PDF Injector - v3.1.0
REDCap crashed due to an unexpected PHP fatal error!
Error message: Uncaught TypeError: array_filter(): Argument #1 ($array) must be of type array, null given in modules\pdf_injector_v3.1.0\pdfInjector.php:314 Stack trace: #0 modules\pdf_injector_v3.1.0\pdfInjector.php(314): array_filter() #1 modules\pdf_injector_v3.1.0\preview.php(13): STPH\pdfInjector\pdfInjector->renderInjection() #2 redcap_v14.0.33\ExternalModules\index.php(146): require('...') #3 {main} thrown File: modules\pdf_injector_v3.1.0\pdfInjector.php Line: 314"
Source:
https://redcap.vumc.org/community/post.php?id=108925&comment=235866