 | Variables Naming Conflict 27 June 2007 01:28 (EST) Recently I had a chance to play a bit with Facebook API, which uses REST-based interface. There is ColdFusion client library developed by Andrew Duckett and called Facebook REST Client CFC and CFMX Facebook Application Starter example written by Cory Johnson. While developing application with use of FBML instead of IFRAME (which works just fine) Facebook server has started throwing "http error 500" upon calls to Callback URL of my application. Source code of error page had details of the error commented out — "Form entries incomplete or invalid".
Digging deeper into the problem I have discovered that CFMX server has following rule for variables naming:
Programming ColdFusion by Rob Brooks-Bilson, Chapter 2, Variables:Avoid choosing variable names that end in _date, _eurodate, _float, _integer, _range, _required, or _time, as these are reserved suffixes for server-side form validation variables and can cause naming conflicts. One of the POST request variable from Facebook server is named FB_SIG_TIME and causing an error.
Fortunately you can use Application.cfm to solve the problem, like this:
<cfif StructKeyExists(form, "FB_SIG_TIME")> <cfset form.FB_TIME_SIG = form.FB_SIG_TIME /> <cfset StructDelete(form, "FB_SIG_TIME", true) /> </cfif> Good luck! Comments Drop a comment... don't be shy |  |