Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions system/web/context/EventHandlerBean.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ component accessors="true" {
}

// Filter by key
if ( !isNull( variables.handlerMetadata[ arguments.key ] ) ) {
return variables.handlerMetadata[ arguments.key ]
var annotations = variables.handlerMetadata.keyExists( "annotations" ) ? variables.handlerMetadata.annotations : variables.handlerMetadata
if ( structKeyExists( annotations, arguments.key ) ) {
return annotations[ arguments.key ]
}

// Nothing found, just return the default value of empty string
Expand Down
12 changes: 12 additions & 0 deletions tests/specs/web/context/EventhandlerBeanTest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,16 @@
expect( this.ehBean.isMetadataLoaded() ).toBe( true );
</cfscript>
</cffunction>

<cffunction name="testGetNestedHandlerMetadata" access="public" returnType="void">
<cfscript>
this.ehBean.setHandlerMetadata( {
name : "PasskeyRegistration",
annotations : { secured : "" }
} );

expect( this.ehBean.getHandlerMetadata( "secured", false ) ).toBe( "" );
expect( this.ehBean.getHandlerMetadata( "missing", false ) ).toBeFalse();
</cfscript>
</cffunction>
</cfcomponent>
Loading