COLDBOX-1453 RestHandler.onEntityNotFoundException() fails on Adobe ColdFusion 2023 - #704
Merged
Merged
Conversation
RestHandler.onEntityNotFoundException() throws MissingArgumentException on Adobe ColdFusion 2023 Resolve the incoming id into a local variable before calling setData(), since ACF 2023 drops the inline Elvis expression and the required data argument ends up missing. Adds a regression spec asserting the id is returned in the 404 response data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lg4ySgho8Woxb5SQN9eqep
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes Adobe ColdFusion 2023 handling of missing-entity REST responses by safely resolving the request ID before calling setData().
Changes:
- Resolves IDs explicitly before setting response data.
- Adds coverage for present and missing IDs.
| File | Description |
|---|---|
tests/specs/RestHandlerTest.cfc |
Tests response data with and without an incoming ID. |
system/RestHandler.cfc |
Ensures setData() receives a valid value on 404 responses. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description
On Adobe ColdFusion 2023,
RestHandler.onEntityNotFoundException()throwsMissingArgumentException: The DATA parameter to the setData function is required but was not passed in.instead of returning a 404. ACF 2023 drops the inlinerc.id ?: ""expression passed toResponse.setData(), so the requireddataargument goes missing. Adobe 2025, Lucee and BoxLang are not affected.This PR resolves the id into a local variable with
structKeyExists( arguments.rc, "id" )first, then passes it tosetData().Found by the ContentBox API test suite on adobe@2023 with ColdBox ^8: every "invalid id or slug" spec failed.
Jira Issues
https://ortussolutions.atlassian.net/browse/COLDBOX-1453
Type of change
Checklist
tests/specs/RestHandlerTest.cfcnow checks the response data with and without an incomingid🤖 Generated with Claude Code
https://claude.ai/code/session_01Lg4ySgho8Woxb5SQN9eqep
Generated by Claude Code