Skip to content

Conversation

@arnav-makkar
Copy link
Contributor

Brief summary of changes

This PR fixes a TypeError that occurred when REDCap sends empty data to the LORIS notifications endpoint, such as when using the "Test" button on the REDCap Data Entry Trigger (DET).

Changes:

  • Added an early validation check in the _handlePOST() method to detect null or empty data
  • Returns a graceful HTTP 200 response when empty data is received
  • Prevents TypeError from being thrown when null is passed to RedcapNotification::__construct()

Link(s) to related issue(s)

…#9895)

When REDCap sends empty data (e.g., via the DET 'Test' button), the notifications endpoint now returns a successful HTTP 200 response instead of throwing a TypeError.

Previously, null data was passed directly to RedcapNotification::__construct() which expects an array type, causing:
  RedcapNotification::__construct(): Argument aces#1 ($props) must be of type array, null given

This fix adds an early check after data parsing to detect null or empty array data and gracefully returns an empty response, preventing the type error while maintaining normal notification processing for valid data.
@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Module: redcap PR or issue related to redcap module labels Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code Module: redcap PR or issue related to redcap module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type error on REDCap test DET button

1 participant