Skip to content

COLDBOX-1453 RestHandler.onEntityNotFoundException() fails on Adobe ColdFusion 2023 - #704

Merged
lmajano merged 1 commit into
developmentfrom
claude/quirky-einstein-b6k6xi
Sep 24, 2026
Merged

lmajano merged 1 commit into
developmentfrom
claude/quirky-einstein-b6k6xi

Conversation

@lmajano

@lmajano lmajano commented Sep 24, 2026

Copy link
Copy Markdown
Member

Description

On Adobe ColdFusion 2023, RestHandler.onEntityNotFoundException() throws MissingArgumentException: The DATA parameter to the setData function is required but was not passed in. instead of returning a 404. ACF 2023 drops the inline rc.id ?: "" expression passed to Response.setData(), so the required data argument 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 to setData().

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

  • Bug Fix

Checklist

  • My code follows the style guidelines of this project cfformat
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works: tests/specs/RestHandlerTest.cfc now checks the response data with and without an incoming id
  • New and existing unit tests pass locally with my changes (not run locally since there's no CFML engine in this environment; CI covers adobe@2023)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Lg4ySgho8Woxb5SQN9eqep


Generated by Claude Code

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
Copilot AI lite review requested due to automatic review settings September 24, 2026 12:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lmajano
lmajano merged commit 81b28e6 into development Sep 24, 2026
25 checks passed
@lmajano
lmajano deleted the claude/quirky-einstein-b6k6xi branch September 24, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants