isDefined not working since migration to CF11
Hello!
We have a system running on Cold Fusion. The server was running on CF7 and we upgraded it to CF11 and now the isDefined are not working anymore.
To be honest I do very few Cold Fusion coding, it's an old system that was not maintained that I just got and I have to manage. I am learning everything.
I've read that isDefined is not the best and would be better to use structKeyExists instead. The problem is there is more than 1900 files and 3000 isDefined to change.
Example :
This line marks an error :
<cfif not isdefined("caller.#attributes.prefix_mandatory##fldname#") or (isdefined("caller.#attributes.prefix_mandatory##fldname#") and trim(evaluate("caller.#attributes.prefix_mandatory##fldname#")) is "")>
Which I corrected and works fine :
<cfif not structKeyExists(caller, '#attributes.prefix_mandatory##fldname#') or (structKeyExists(caller,'#attributes.prefix_mandatory##fldname#"') and trim(evaluate("caller.#attributes.prefix_mandatory##fldname#")) is "")>
Error message :
"Error","ajp-bio-8014-exec-1","09/26/17","09:59:25","database_name","Complex object types cannot be converted to simple values.The expression has requested a variable or an intermediate expression result as a simple value. However, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values. <p> The most likely cause of the error is that you tried to use a complex value as a simple one. For example, you tried to use a query variable in a cfif tag. The specific sequence of files included or processed is: [FILE_PATH], line: 160 "
I have the same problem on my local Cold Fusion Builder than on the Web Server (our DEV environment), both on CF11.
Is it normal that it use to work great but it's not working anymore? Is there another workaround or another thing I missed (ex. Admin setting, other configuration, etc) ? I'd like to find a solution that would not necessitate to change the code.
