ryanmac said the following on 26/05/10 11:16:
What exactly are you trying to do? Where is "userId" coming from? The "variable" attribute ultimately gets run through the CFML evaluate() function. So "userId" doesn't have a scope attached to it. Are you trying to get it from the request scope or something?Hi, i've started testing our apps with mach-ii 1.8.0 (updating from 1.5.0) and any of event args that use the "variable" attribute to alias a var in the config file fail to set the alias.event-arg name="ownerId" variable="userId" so in this example ownerId doesn't get set Any ideas, is this a bug?
Here is the code in 1.5 that does that:110 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L110> <cffunction name="getArgVariableValue" access="private" returntype="any" output="false"> 111 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L111> <cfset var value = "" /> 112 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L112> <cfif IsDefined(getArgVariable())> 113 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L113> <cfset value = Evaluate(getArgVariable()) /> 114 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L114> </cfif> 115 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L115> <cfreturn value /> 116 <http://trac.mach-ii.com/machii/browser/framework/1-5-0/trunk/framework/commands/EventArgCommand.cfc#L116> </cffunction>
Here is the relevant code in 1.8.1:145 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L145> <cffunction name="getArgVariableValue" access="private" returntype="any" output="false" 146 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L146> hint="Gets an arg variable value by using evaluate."> 147 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L147> 148 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L148> <cfset var value = "" /> 149 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L149> <cfset var log = getLog() /> 150 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L150> 151 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L151> <cfif IsDefined(getArgVariable())> 152 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L152> <cfset value = Evaluate(getArgVariable()) /> 153 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L153> <cfelseif log.isDebugEnabled()> 154 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L154> <cfset log.debug("No value found for arg variable named '#getArgVariable()#' for event-arg named '#getArgName()#'.") /> 155 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L155> </cfif> 156 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L156> 157 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L157> <cfreturn value /> 158 <http://trac.mach-ii.com/machii/browser/framework/1-8-1/trunk/framework/commands/EventArgCommand.cfc#L158> </cffunction>
As you can see, the code is nearly the same (with the addition of logging statements). Have turned in the Mach-II logging out so you can see what is going on? The simplest way to turn that on is to add a simple property CFC to your configuration file and reload your application:
http://trac.mach-ii.com/machii/wiki/IntroToLogging#GettingStarted .pjf -- You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en ***New URLs as of April 29th, 2010*** SVN: http://svn.mach-ii.com/machii/ Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/
