From e19380ffc39bf5d999f2ed4033d0bb4e9c370412 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:02:36 +0000 Subject: [PATCH 1/2] Initial plan From 28d85361dfa1577e9f38f7b9ff4442399f94d905 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:09:14 +0000 Subject: [PATCH 2/2] Fix ColdBox 8 incompatibility by replacing processState with announce Co-authored-by: elpete <2583646+elpete@users.noreply.github.com> --- models/HyperRequest.cfc | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/models/HyperRequest.cfc b/models/HyperRequest.cfc index fcd5597..3c56768 100644 --- a/models/HyperRequest.cfc +++ b/models/HyperRequest.cfc @@ -217,6 +217,8 @@ component accessors="true" { // This is overwritten by the HyperBuilder if WireBox exists. variables.interceptorService = { "processState" : function() { + }, + "announce" : function() { } }; @@ -1096,7 +1098,7 @@ component accessors="true" { for ( var callback in variables.requestCallbacks ) { callback( this ); } - variables.interceptorService.processState( "onHyperRequest", { "request" : this } ); + announceInterception( "onHyperRequest", { "request" : this } ); try { var res = shouldFake() ? generateFakeRequest() : variables.httpClient.send( this ); @@ -1104,7 +1106,7 @@ component accessors="true" { for ( var callback in variables.responseCallbacks ) { callback( res ); } - variables.interceptorService.processState( + announceInterception( "onHyperResponse", { "response" : res, @@ -1166,7 +1168,7 @@ component accessors="true" { for ( var callback in variables.requestCallbacks ) { callback( this ); } - variables.interceptorService.processState( "onHyperRequest", { "request" : this } ); + announceInterception( "onHyperRequest", { "request" : this } ); return httpClient.debug( this ); } @@ -1572,4 +1574,19 @@ component accessors="true" { return application.hyperVersion; } + /** + * Announces interception events using the appropriate method for backward compatibility. + * Uses announce() for ColdBox 8+ and falls back to processState() for older versions. + * + * @interceptionPoint The name of the interception point + * @data The data to pass to the interceptors + */ + private void function announceInterception( required string interceptionPoint, struct data = {} ) { + if ( structKeyExists( variables.interceptorService, "announce" ) ) { + variables.interceptorService.announce( arguments.interceptionPoint, arguments.data ); + } else { + variables.interceptorService.processState( arguments.interceptionPoint, arguments.data ); + } + } + }