Ticket #34 (reopened defect)
Partial case-sensitivity to alias names on reactorFactory.createRecord()
| Reported by: | jfirsenbaum@… | Owned by: | dhughes |
|---|---|---|---|
| Type: | defect | Priority: | normal |
| Milestone: | 1.0 Release | Component: | Reactor - Reactor Factory |
| Version: | 1.0 | Severity: | normal |
| Keywords: | alias case-sensitive spam | Cc: |
Description
Reactor is partially case-sensitive to the alias used to create a new record. It should either be stricty case-sensitive or strictly not - I'd vote for not.
The problem occurs in validation while parsing the dictionary xml in the following scenario:
<object name="CreditCard">
<hasOne name="Address">
...
Calling the child address with the wrong case:
<cfset address = getReactor().createRecord('address')>
<cfset card.setAddress(address)>
Here's where the error is thrown:
<cfset card.validate()>
Here's a stack trace:
Message An error occured while Transforming an XML document.
Detail Empty expression!
Extended Info
Tag Context /usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (144)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (151)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (151)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectTranslator.cfc (100)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/core/objectFactory.cfc (201)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/reactorFactory.cfc (80)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (332)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/project/club/Validator/AddressValidator.cfc (10)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (83)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (145)
/usr/local/apache-tomcat-5.5.16/webapps/cfusion/reactor/base/abstractRecord.cfc (85)
The problem occurs because the alias passed into reactorFactory.createRecord('alias') is used by the objectFactory to configure the record:
line 145: <cfset GeneratedObject = GeneratedObject.configure(getConfig(), arguments.alias, getReactorFactory(), getConvention(), metadata) />
The objectTranslator chokes on line 144 because it does a XMLSearch() on "address", not "Address"
Here's a possible fix:
at the top of objectFactory.create()
<cfset arguments.alias = getconfig().getobjectconfig(arguments.alias).object.xmlAttributes.alias>

