From 0cd3860afca69875353e97f17d742474b0d285b6 Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Thu, 2 Oct 2025 19:11:37 -0400 Subject: [PATCH 1/2] Resolves incorrect metadata lookup when resolving a class that has a different entity name than the file name --- system/core/dynamic/ObjectPopulator.cfc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/core/dynamic/ObjectPopulator.cfc b/system/core/dynamic/ObjectPopulator.cfc index 00b903de0..3e25995a5 100644 --- a/system/core/dynamic/ObjectPopulator.cfc +++ b/system/core/dynamic/ObjectPopulator.cfc @@ -557,11 +557,11 @@ component accessors="true" singleton { var relationMetaClass = ""; // BoxLang Prime if ( arguments.relationalMeta.properties[ arguments.key ].keyExists( "className" ) ) { - relationMetaClass = listLast( arguments.relationalMeta.properties[ arguments.key ].className, "." ) + relationMetaClass = arguments.relationalMeta.properties[ arguments.key ].className; } // CFML Legacy if ( arguments.relationalMeta.properties[ arguments.key ].keyExists( "cfc" ) ) { - relationMetaClass = listLast( arguments.relationalMeta.properties[ arguments.key ].cfc, "." ) + relationMetaClass = arguments.relationalMeta.properties[ arguments.key ].cfc; } // 1.) name match @@ -571,10 +571,10 @@ component accessors="true" singleton { // 2.) attempt match on class metadata on the property: // property name="role" cfc="security.Role" // property name="role" class="security.Role" - else if ( validEntityNames.findNoCase( relationMetaClass ) ) { - targetEntityName = relationMetaClass; + else if ( validEntityNames.findNoCase( listLast( relationMetaClass, "." ) ) ) { + targetEntityName = listLast( relationMetaClass, "." ); } - // 3.) class lookup + // 3.) class lookup - this would only fire if the `cfc` or `className` attribute was pointing to a CFC, but the entity name was different than the file name else { var annotations = server.keyExists( "boxlang" ) ? getClassMetadata( relationMetaClass ).annotations : getComponentMetadata( relationMetaClass From ae8245374ccd9b6ea7be7a58913719a6b312b03b Mon Sep 17 00:00:00 2001 From: Jon Clausen Date: Thu, 2 Oct 2025 21:10:53 -0400 Subject: [PATCH 2/2] Update system/core/dynamic/ObjectPopulator.cfc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- system/core/dynamic/ObjectPopulator.cfc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/dynamic/ObjectPopulator.cfc b/system/core/dynamic/ObjectPopulator.cfc index 3e25995a5..257b3e48b 100644 --- a/system/core/dynamic/ObjectPopulator.cfc +++ b/system/core/dynamic/ObjectPopulator.cfc @@ -574,7 +574,7 @@ component accessors="true" singleton { else if ( validEntityNames.findNoCase( listLast( relationMetaClass, "." ) ) ) { targetEntityName = listLast( relationMetaClass, "." ); } - // 3.) class lookup - this would only fire if the `cfc` or `className` attribute was pointing to a CFC, but the entity name was different than the file name + // 3.) class lookup - this would only execute if the `cfc` or `className` attribute was pointing to a CFC, but the entity name was different than the file name else { var annotations = server.keyExists( "boxlang" ) ? getClassMetadata( relationMetaClass ).annotations : getComponentMetadata( relationMetaClass