Conversation
…#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.
MaximeBICMTL
approved these changes
Jan 17, 2026
Comment on lines
+111
to
+112
| // Handle empty data gracefully (e.g., REDCap DET "Test" button sends | ||
| // empty data). |
Contributor
There was a problem hiding this comment.
Suggested change
| // Handle empty data gracefully (e.g., REDCap DET "Test" button sends | |
| // empty data). | |
| // Return an empty response when receiving empty data, which is notably | |
| // sent by the test button of the REDCap data entry trigger. |
Nit (optional): I personally do not like to use subjective wording (like "gracefully") or acronyms in code comments. But that may be a matter of personal taste, the PR is good.
arnav-edmo
approved these changes
Jan 17, 2026
Contributor
Author
|
Thank you. Please merge when free |
Contributor
|
@arnav-makkar @driusan will handle merging whenever he gets the time. Also, letting the suggestion open for now. |
GeorgeMurad
pushed a commit
to GeorgeMurad/Loris
that referenced
this pull request
Jan 21, 2026
…#9895) (aces#10257) This 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()` * Resolves aces#9895
skarya22
pushed a commit
to skarya22/Loris
that referenced
this pull request
Feb 5, 2026
…#9895) (aces#10257) This 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()` * Resolves aces#9895
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:
RedcapNotification::__construct()Link(s) to related issue(s)