Copy link to clipboard
Copied
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?
ilssac wrote:
csgaraglino wrote:
<cf_icwsForm2dbaction="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)#
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
csgaraglino wrote:
<cf_icwsForm2dbaction="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.
Copy link to clipboard
Copied
I'm nor familiar with this system, can I attach the CT somewhere?
Copy link to clipboard
Copied
No, no method that I am aware of.
One of many complaints that many of us have about this "system"
Copy link to clipboard
Copied
ilssac wrote:
csgaraglino wrote:
<cf_icwsForm2dbaction="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#">
Copy link to clipboard
Copied
Ian nails it here. Without Duplicate, you are passing the form to the custom tag by reference rather than by value. When something is passed by reference, you really only have one thing, and multiple ways of accessing that thing. When you use Duplicate, you create a completely separate copy of that thing, and changing the duplicated value doesn't affect the original value.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.
Read this before you post:
http://forums.adobe.com/thread/607238