Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF8 has stopped populating form scope

LEGEND ,
Apr 24, 2010 Apr 24, 2010

G'day

For reasons that escape (and somewhat bamboozle ~) me, my CF8 server (just using the internal JWS for the web server) has stopped populating the form scope when a form is submitted.  Say I run this code:

<cfdump var="#form#">

<form action="<cfoutput>#CGI.script_name#</cfoutput>" method="post" name="frm1">
     <input type="text" name="txt1" value="" /><br />
     <input type="submit" name="btnSubmit1" value="Submit" />
</form>

When I submit the form, I simply get the dump outputting an empty struct.  I have verified that the HTTP request is being made properly: it's a POST, and the form field/value pairs are in there too.  Just nothing in the form scope.

I'm pretty sure there's no "stop the form scope from working" setting in CF, and I cannot find anything that might contribute to such behaviour.  And, also, I've not changed anything in the environment recently (although I would say that, obviously 😉

It's not some weirdness with an Application.cf(c|m) buggering things up, as I have a blocking Application.cfm in the same dir as the file.  So the first line of CF code that gets executed is the <cfdump>.  I have a 99.9% certainty it is nothing in the code causing this.  Plus the above is just my repro case.  The actual form I'm working on is in a completely different directory subtree, with no common ancestor to the one my test code is in, and - indeed - no commonality of code.

I have stop/started CF a couple of times.

There is nothing wrong with the form that I can see, and BlueDragon serves the form up (and has its form scope populated) no problems.

And when I was working on this code the day before y/day, it all worked fine on CF8 then.

Weird.

Any ideas of where to look to check what might be going on?

Cheers for any suggestions.

--

Adam

Oops.  Submitted before I had finished typing.  Updated so that the middle para makes sense.

1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 24, 2010 Apr 24, 2010

Err... OK... weird.  It's started working again now.  And this didn't seem to require any specific input from me... it just started working again.  I just cracked on with my coding, thinking "well if I need to test anything, I'll use BlueDragon instead, and deal with this later", and inadvertantly refreshed the CF8 window rather than the BD one, and the form worked fine.  I went back to the test form I posted before, and simply reloaded it (resending the form data), and that worked too.  And that definitely had not had any changes made to it since I last saw it not work.

"It's just one of those things", I guess.

If anyone's had this happen before and knows why, I'd still be keen to know WTF was going on, but for my immediate purposes, this issue has self-corrected.

Cheers.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2010 Apr 24, 2010

There's one possibility I can think of. When you open the page for the first time, no form is submitted, and so the form scope dumped is the standard empty struct you expect. Now, it is quite likely that Coldfusion or the browser cached that version of the page, and reused it, instead of a fresh version.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 25, 2010 Apr 25, 2010

Good thinking, but in the case of the repro code I quoted, I had never browsed to it before, so there was nothing previously to have been cached. Similarly with the actual form I was working on, various debugging elements I had added in were processing and rendering just fine.

--

Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2010 Apr 25, 2010

Adam Cameron. wrote:

Good thinking, but in the case of the repro code I quoted, I had never browsed to it before, so there was nothing previously to have been cached. Similarly with the actual form I was working on, various debugging elements I had added in were processing and rendering just fine.

It's a self-submitting form page. The only way to have submitted the form is to have first browsed to the page!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 26, 2010 Apr 26, 2010

Good thinking, but in the case of the repro code I quoted, I had never browsed to it before, so there was nothing previously to have been cached. Similarly with the actual form I was working on, various debugging elements I had added in were processing and rendering just fine.

It's a self-submitting form page. The only way to have submitted the form is to have first browsed to the page!

Haha, yes, indeed that one is.  Well-spotted.  The other one isn't and the code I posted is a gross simplification of most of the test rigs I had.  You weren't to know that.  But rest assured it's not a CF or a browser caching issue.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 25, 2010 Apr 25, 2010

Regarding:

If anyone's had this happen before and knows why, I'd still be keen to  know WTF was going on, but for my immediate purposes, this issue has  self-corrected.

It's happened to us.  In our case, the page was being served twice, I could see it happening.  I would submit the form and everything would behave normally.  Then, as soon as the status bar said "Done", the browser would start processing again and I'd get an error for a missing form variable.  This behaviour was confirmed by viewing the IIS logs.  We never did determine why it was happening.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 26, 2010 Apr 26, 2010

It's happened to us.  In our case, the page was being served twice, I could see it happening.  I would submit the form and everything would behave normally.  Then, as soon as the status bar said "Done", the browser would start processing again and I'd get an error for a missing form variable.  This behaviour was confirmed by viewing the IIS logs.  We never did determine why it was happening.

Interesting.  I'm not getting that double-load thing though.  The browser symptom wasn't there, adn I was watching the HTTP traffic and it was definitely only being requested/responded to the once.

--
Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 23, 2010 May 23, 2010

Argh!

It's happening again.

I augmented the test rig this time to also dump out getHttpRequestData(), and I can see the form fields in there.  Just not in the form scope.

I shall reboot and see what happens after that...

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2010 May 26, 2010

Weird... if I crank up my CF9 instance and try the same thing, the same thing happens, so I can't understand how it's a CF thing... but equally I can't think what else it would be.  Also weird is that if I refresh the browser after the initial form submission "fails", then the stuff does show up in the form scope (this is both on the CF8 & CF9 instance).  I'm not sure what to make of that.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 18, 2011 Jan 18, 2011

I know this post is ages ago, but I get a similar issue which is very intermittent did you ever find out the cause?

  • IE reports the page as expired; then the form vars don't exist.
  • Form structure is empty (no form.fieldnames)
  • getHttpRequestData().method is being reported as a GET
  • cgi.http_referer is blank

Cannot determine if this is cause by network issues or the webserver. (CF8, IIS6)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 18, 2011 Jan 18, 2011
LATEST

Sorry, no: I didn't make any headway with this.  It's happened again, but I just shrugged and left it.  I'm not using this machine for much development @ the mo' either, for that matter.

I've not seen this happen before on any other CF8 install I have used (and I am using CF8 all day every day on my work machine).

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources