Skip to content

Commit b4bc8a4

Browse files
authored
Merge pull request #624 from ColdBox/patch/Object-Populator-Fix
ObjectPopulator Class Lookup Fix
2 parents b31e191 + ae82453 commit b4bc8a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

system/core/dynamic/ObjectPopulator.cfc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,11 +557,11 @@ component accessors="true" singleton {
557557
var relationMetaClass = "";
558558
// BoxLang Prime
559559
if ( arguments.relationalMeta.properties[ arguments.key ].keyExists( "className" ) ) {
560-
relationMetaClass = listLast( arguments.relationalMeta.properties[ arguments.key ].className, "." )
560+
relationMetaClass = arguments.relationalMeta.properties[ arguments.key ].className;
561561
}
562562
// CFML Legacy
563563
if ( arguments.relationalMeta.properties[ arguments.key ].keyExists( "cfc" ) ) {
564-
relationMetaClass = listLast( arguments.relationalMeta.properties[ arguments.key ].cfc, "." )
564+
relationMetaClass = arguments.relationalMeta.properties[ arguments.key ].cfc;
565565
}
566566

567567
// 1.) name match
@@ -571,10 +571,10 @@ component accessors="true" singleton {
571571
// 2.) attempt match on class metadata on the property:
572572
// property name="role" cfc="security.Role"
573573
// property name="role" class="security.Role"
574-
else if ( validEntityNames.findNoCase( relationMetaClass ) ) {
575-
targetEntityName = relationMetaClass;
574+
else if ( validEntityNames.findNoCase( listLast( relationMetaClass, "." ) ) ) {
575+
targetEntityName = listLast( relationMetaClass, "." );
576576
}
577-
// 3.) class lookup
577+
// 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
578578
else {
579579
var annotations = server.keyExists( "boxlang" ) ? getClassMetadata( relationMetaClass ).annotations : getComponentMetadata(
580580
relationMetaClass

0 commit comments

Comments
 (0)