Re: ft:object small bug with r_stFields?

Justin Carter <[email protected]> Thu, 23 Jan 2014 11:17:19 +1100
Newsgroups gmane.comp.cms.farcry.devel
Message-ID <CAMLJQfumTzS2v=Jb8caWT9nm_xLk=83CkknsMGuZ2xA2R-BZDw@mail.gmail.com>
Did this code come from anywhere in Core, or was it custom code? You're
right, a "prefix" value passed to ft:object of a UUID starting with a
number would be bad... From memory, by default FarCry uses "fc" followed by
a UUID with the dashes stripped, so perhaps we just need to clarify in the
code and the docs that the "prefix" value must be a valid CF variable name
- definitely something to be aware of.

cheers,
Justin

cheers,
Justin

--
Justin Carter
http://www.madfellas.com/blog
http://twitter.com/justincarter


On Thu, Jan 23, 2014 at 9:41 AM, Phillip Rasmussen <
[email protected]> wrote:

> Hi All,
> FC6.2.10 on linux
> Don't know if this is a bug or I'm doing something wrong but...
>
> After a server side validation fails on a form and I want to pull the
> value of a submitted field (so I can create a custom select box and use
> this value to mark it as selected) i use:
>
> <cfset thePrefix =
> replace(application.fc.utils.createJavaUUID(),'-','','ALL')>
> <ft:object typename="myForm" prefix="#thePrefix#"
> stPropMetadata="#stPropMetadata#" lFields="mySelectField"
> key="therecanbeonlyone" r_stFields="test" />
>
> I then get an error:
>
> The string
> caller.Request.farcryForm.stObjects.0204781DCB6E034195D8598F646AB09E.MetaData.mySelectField.Label
> is not a valid ColdFusion variable name.
>
> Notice the thePrefix value starts with a number. Of course this error
> doesn't occur when thePrefix starts with an alpha.
>
> I've resolved the issue by
>
> <cfset thePrefix =
> rereplace(replace(application.fc.utils.createJavaUUID(),'-','','ALL'),'^[0-9]{1}','Z')>
> This just checks if the first character is a number and then replaces it
> with a 'Z'.
>
> Without digging too far into exactly which line is causing the error in
> object.cfm I thought it might be pointing out (no doubt somewhere around a
> caller function). Perhaps it's worth changing createJavaUUID() to check. I
> don't know how many other processes might be suffering the same issue.
>
> Regards
> Phil
>
> --
> You received this message cos you are subscribed to "farcry-dev" Google
> group.
> To post, email: farcry-dev-/[email protected]
> To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
> For more options: http://groups.google.com/group/farcry-dev
> --------------------------------
> Follow us on Twitter: http://twitter.com/farcry
> ---
> You received this message because you are subscribed to the Google Groups
> "farcry-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev-/[email protected]
To unsubscribe, email: farcry-dev+unsubscribe-/[email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
--- 
You received this message because you are subscribed to the Google Groups "farcry-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to farcry-dev+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
For more options, visit https://groups.google.com/groups/opt_out.