lsgs / redcap-record-autonumbering

REDCap External Module enabling different record auto-numbering options
GNU General Public License v3.0
10 stars 8 forks source link

Add check that the module is enabled before acting in __construct #6

Closed ChemiKyle closed 3 years ago

ChemiKyle commented 3 years ago

Closes #5

Given that __construct() seems to run on every page with no regard for the module's activation status at the project level, this modules construct block should probably be moved to a redcap_module_project_enable hook.

A bit more digging shows that unaffected versions of redcap keep PROJECT_ID as 0 if the module is inactive.

Outside the scope of this specific PR, now that the EM repo is private (RIP) I had to hunt for complete hook documentation (the Documentation link in the ControlCenter is quite lacking); best bet is to go to redcap_vx.y.z/ExternalModules/docs/official-documentation.md in your filesystem.