If your code contains the actual text “form.verify-v1” as a variable
then it would error in CF, and every CFML engine, because “-” cannot be
used there; it gets confused with the subtraction operator.
(This isn’t unique to CFML. It’s basically a result of ASCII only
having a single character for both hyphen and minus, along with spaces
being optional.)
The solution in CFML (works in all engines) is to replace the dot
notation with bracket notation, i.e:
That code ran for years under ACF9. It did not under Railo and now Lucee.
I will try the bracket approach. Thanks.
Can you pls post some code (like a repro case / http://sscce.org/) that
demonstrates that “working” on CF9?On Friday, 20 March 2015 14:27:49 UTC, Michael Muller wrote:
On Sat, Mar 14, 2015 at 4:11 PM, Peter Boughton <lu...@sorcerersisle.com <javascript:>> wrote:
If your code contains the actual text “form.verify-v1” as a variable
then it would error in CF, and every CFML engine, because “-” cannot be
used there; it gets confused with the subtraction operator.
(This isn’t unique to CFML. It’s basically a result of ASCII only
having a single character for both hyphen and minus, along with spaces
being optional.)
The solution in CFML (works in all engines) is to replace the dot
notation with bracket notation, i.e:
That code ran for years under ACF9. It did not under Railo and now Lucee.
I will try the bracket approach. Thanks.
Mik Muller, president Montague WebWorks
(413) 320-5336 http://www.MontagueWebWorks.comOn Sat, Mar 14, 2015 at 4:11 PM, Peter Boughton <@Peter_Boughton> wrote:
If your code contains the actual text “form.verify-v1” as a variable
then it would error in CF, and every CFML engine, because “-” cannot be
used there; it gets confused with the subtraction operator.
(This isn’t unique to CFML. It’s basically a result of ASCII only
having a single character for both hyphen and minus, along with spaces
being optional.)
The solution in CFML (works in all engines) is to replace the dot
notation with bracket notation, i.e:
Here’s my original code. It broke on the third line, only when editing
fields that had hyphens in it. This code ran for years under ACF9. Not sure
why I have the magic.
Here’s my original code. It broke on the third line, only when editing
fields that had hyphens in it. This code ran for years under ACF9. Not sure
why I have the magic.
Sure. Well, it wasn’t intentional. I have a table of meta tag variables and values, making it easy to add new ones and update existing ones, and have them all just stuff into the head tag. These two variables in question are Google’s. Being able to support their naming convention is handy.
On Apr 2, 2015, at 8:47 AM, Walter Seethaler <@Walter_Seethaler> wrote:
As nobody has mentioned it yet. The ACF documentation contains the variable naming rules and hyphens are not allowed there. Even if it works, I wouldn’t consider it stable.
A variable name must begin with a letter, underscore, or Unicode currency symbol.
The initial character can by followed by any number of letters, numbers, underscore characters, and Unicode currency symbols.
Am Donnerstag, 2. April 2015 14:38:12 UTC+2 schrieb Michael Muller:
Interesting. Well, I wasn’t doing a cfset on the var, just a cfparam and a read in a query, both of which worked in ACF. Anyway, it’s fixed now.
Here’s my original code. It broke on the third line, only when editing fields that had hyphens in it. This code ran for years under ACF9. Not sure why I have the magic.
BTW, this tripped an error on Lucee 5.3.8.206, even using underscores, so it’s not just the - sign, unless Lucee considers underscore _ to also be a mathematical operator.
This works: <cfparam name="form['#ID#_newstyle']" default="">
This does not: <cfparam name="form.#ID#_newstyle" default="">
Oddly enough, this DOES work: evaluate("form.#ID#_newstyle") soooooo, go figure.