My company works with ColdFusion and has had this problem in different variations for years now. It's time to get it solved.
The scenario is very simple:
<cfparam name="session.check" default="0">
<cfif NOT isDefined('session.check') OR
session.check IS 0>
<cfset ok=1>
</cfif>
Now ColdFusion throws an error:
Element CHECK is undefined in SESSION. The error occurred on line 18.
For those who can read something out of it, here's the detailed stack trace:
coldfusion.runtime.UndefinedElementException: Element CHECK is undefined in SESSION. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1694) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1612) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1747) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1740) at cfindex2ecfm123677868._factor9(C:\path\index.cfm:18) at ...
If cfparam is used or just a cfset doesn't really matter. Also, this is NOT a simplified example, this very error occured on our server. With no single line between the variable being set and read.
We're running ColdFusion 8.0.1.195765. Any ideas?
Thanks in advance!