Skip to main content
csgaraglino
Known Participant
December 3, 2010
Answered

Form variable rebuilt, data missing?

  • December 3, 2010
  • 1 reply
  • 775 views

Ok, so I understand th structCopy vs duplicate. I now have a action template that processes a FORM variable form a post. The form variable is intact until the template runs a custom tag. at the line following the CT the FORM variable is different and has limited data. Actually the data is only the "visible" fields from the form? The CT is just a simple set of scripts that takes the form data and puts it in the database for latter retrieval. All hidden fields & the fieldNames field are gone? So what is causing these once stable variables to fall apart like this? Is there anyway to lock them down to keep them intact?

    This topic has been closed for replies.
    Correct answer ilssac

    csgaraglino wrote:

    <cf_icwsForm2db

         action="store"

         formData="#form#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    That is the code that calls the custom tag.  It doesn't really tell one much about what the custom tag actually does.

    It's what is going on in the icwsForm2db.cfm file that matters.  This could very well be another place the "pointer" versus "copy" is getting you.  Before Java, formData="#form#" was probably creating a copy.  Now it is creating a pointer, and as a pointer anything done to the data via the pointer is done to the original since they are one and the same data in the same location in memory.


    ilssac wrote:

    csgaraglino wrote:

    <cf_icwsForm2db

         action="store"

         formData="#form#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    Sorry I didn't note this earlier.  But the quick simple fix to make it work like is sounds like it was working on the CF5 system, would be to apply the same lesson from your other post.

    <cf_icwsForm2db

         action="store"

         formData="#duplicate(form)#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    1 reply

    ilssac
    Inspiring
    December 3, 2010

    That shouldn't be happening and I've never experienced anything like it.

    My only idea is that something inside the custom tag is modifying the forum structure while it is processing.  But since I have no idea about what is going on in the custom tag, I can't do more than just speculate.

    csgaraglino
    Known Participant
    December 3, 2010

    I searched it hard and could not find anything in there?

    Before:

    <cf_icwsForm2db

         action="store"

         formData="#form#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    Here is my work-around:

    <cfset myFormData = duplicate(form)>
    <cf_icwsForm2db

         action="store"

         formData="#myFormData#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    T test this, I just dumped FORM before and after.

    For my work-around, I did nothing to the CT code... Just created the new var and passed it...

    Weird?

    ilssac
    Inspiring
    December 3, 2010

    csgaraglino wrote:

    <cf_icwsForm2db

         action="store"

         formData="#form#"

         emailTo="#evaluate(icwsUserEmail)#"

         storeEmailLists="#icwsEmailLists2db#"

         verificationID="#verificationID#"

         verificationVAR="#verificationVAR#">

    That is the code that calls the custom tag.  It doesn't really tell one much about what the custom tag actually does.

    It's what is going on in the icwsForm2db.cfm file that matters.  This could very well be another place the "pointer" versus "copy" is getting you.  Before Java, formData="#form#" was probably creating a copy.  Now it is creating a pointer, and as a pointer anything done to the data via the pointer is done to the original since they are one and the same data in the same location in memory.