diff --git a/core/api.cfc b/core/api.cfc index 71e900b6..69d111bd 100644 --- a/core/api.cfc +++ b/core/api.cfc @@ -430,8 +430,17 @@ <cffunction name="getBeanListFromColdSpring" access="private" output="false" returntype="string"> <cfset var local = StructNew() /> <cfset local.beans = application._taffy.externalBeanFactory.getBeanDefinitionList() /> + <cfset local.beanList = "" /> + <cfloop collection="#local.beans#" item="local.beanName"> - <cfif local.beans[local.beanName].instanceOf('taffy.core.resource')> + <!--- + Can't call instanceOf() method on beans generated by factories; there is no + class property on factory-generated beans, and it throws an error in ColdSpring 1.2. + Temporary patch is to skip those beans, but we'd really either want to examine the + return type metadata on the factory method or find some other way to determine if + this is a Taffy bean. + ---> + <cfif local.beans[local.beanName].getBeanClass() NEQ "" and local.beans[local.beanName].instanceOf('taffy.core.resource')> <cfset local.beanList = listAppend(local.beanList, local.beanName) /> </cfif> </cfloop> @@ -440,7 +449,7 @@ <cffunction name="inspectMimeTypes" access="private" output="false" returntype="void"> <cfargument name="customClassDotPath" type="string" required="true" hint="dot-notation path of representation class" /> - <cfif application._taffy.factory.beanExists(arguments.customClassDotPath)> + <cfif application._taffy.factory.containsBean(arguments.customClassDotPath)> <cfset _recurse_inspectMimeTypes(getMetadata(application._taffy.factory.getBean(arguments.customClassDotPath))) /> <cfelse> <cfset _recurse_inspectMimeTypes(getComponentMetadata(arguments.customClassDotPath)) /> diff --git a/core/factory.cfc b/core/factory.cfc index 826d27bb..ce2b5e52 100644 --- a/core/factory.cfc +++ b/core/factory.cfc @@ -6,6 +6,10 @@ function init(){ return this; } + // Proxy to beanExists to provide similar interface to ColdSpring + function containsBean(beanName){ + return beanExists(arguments.beanName); + } function beanExists(beanName){ if (structKeyExists(this.beans, arguments.beanName)){ return true; diff --git a/core/resource.cfc b/core/resource.cfc index 340cb3d3..40c85071 100644 --- a/core/resource.cfc +++ b/core/resource.cfc @@ -24,7 +24,7 @@ ---> <cffunction name="getRepInstance" access="private" output="false"> <cfargument name="repClass" type="string" /> - <cfif application._taffy.factory.beanExists(arguments.repClass)> + <cfif application._taffy.factory.containsBean(arguments.repClass)> <cfreturn application._taffy.factory.getBean(arguments.repClass) /> <cfelse> <cfreturn createObject("component", arguments.repClass) />