Skip to content

Commit b6b988d

Browse files
committed
fix(BaseGrammar): Support official way of announcing interceptors since ColdBox 6
1 parent 851da0c commit b6b988d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

models/Grammars/BaseGrammar.cfc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ component displayname="Grammar" accessors="true" singleton {
6969
// These are overwritten by WireBox, if it exists.
7070
variables.interceptorService = {
7171
"processState": function() {
72+
},
73+
"announce": function() {
7274
}
7375
};
7476
variables.log = {
@@ -142,7 +144,12 @@ component displayname="Grammar" accessors="true" singleton {
142144
* This method exists because the API for InterceptorService differs between ColdBox and CommandBox
143145
*/
144146
private function tryPreInterceptor( data ) {
145-
variables.interceptorService.processState( "preQBExecute", data );
147+
param variables.useAnnounceMethodForInterceptorService = variables.interceptorService.keyExists( "announce" );
148+
if ( variables.useAnnounceMethodForInterceptorService ) {
149+
variables.interceptorService.announce( "preQBExecute", data );
150+
} else {
151+
variables.interceptorService.processState( "preQBExecute", data );
152+
}
146153
return;
147154
}
148155

0 commit comments

Comments
 (0)