Skip to content
This repository has been archived by the owner on Dec 23, 2018. It is now read-only.

Issue with Firebug: GET request erease form's data #23

Open
benchimols opened this issue Jul 13, 2011 · 3 comments
Open

Issue with Firebug: GET request erease form's data #23

benchimols opened this issue Jul 13, 2011 · 3 comments

Comments

@benchimols
Copy link

Hello,

I've been trying to make formwizard working since hours, and it doesn't work because of firefox/firebug incompatibility. Anyway this is only guess, but strong because it starts working perfectly while disabling firebug :)

Versions:

  • Firefox 5.0
  • Firebug 1.7.3
  • Django 1.3
  • django-formwizard 1.0

Error description:

While going from one step to another, a POST request AND a GET request is done. I really don't know why.
But side effect is GET request erease the stored data of the previous form, as described here (https://github.com/stephrdev/django-formwizard/blob/master/formwizard/views.py#L224)

As we could expect, the final re-validation do not work (see https://github.com/stephrdev/django-formwizard/blob/master/formwizard/views.py#L316), since previous data are not found.

From the user point of view, all steps passes, but then he's redirected to the first step without any futher information or error description.

Error logs:

[13/Jul/2011 07:01:41] "GET /wizard/ HTTP/1.1" 200 96922
[13/Jul/2011 07:01:42] "GET /wizard/ HTTP/1.1" 200 96870
# --> Step 1 is displayed
[13/Jul/2011 07:01:45] "POST /wizard/ HTTP/1.1" 200 119399
[13/Jul/2011 07:01:47] "GET /wizard/ HTTP/1.1" 200 97464
# --> Step 2 is displayed
[13/Jul/2011 07:01:52] "POST /wizard/ HTTP/1.1" 200 98267
[13/Jul/2011 07:01:54] "GET /wizard/ HTTP/1.1" 200 97499
# --> Step 3 is displayed
[13/Jul/2011 07:01:55] "POST /wizard/ HTTP/1.1" 200 97844
[13/Jul/2011 07:01:57] "GET /wizard/ HTTP/1.1" 200 97774
# --> Step 1 is displayed without any error message

When there is a POST request, GET request should not occur ...

I didn't found any useful information in firebug ...

Solution:

Disable Firebug ?

@benchimols
Copy link
Author

Well, work well with beta version Firebug-1.8.0b5 ... still a mystery for me

And by the way not really a django-formwizard issue, but I think it worth having it written for the community.

@funkybob
Copy link

Also worth noting is the following override for the get method will allow people to come back and continue session based forms

def get(self, *args, **kwargs):
    self.storage.current_step = self.steps.first
    form = self.get_form(
        data=self.storage.get_step_data(self.steps.current),
        files=self.storage.get_step_files(self.steps.current))
    return self.render(form)

It's basically a cut down version of the wizard_prev_step handling.

@carmelly
Copy link

I had a similar issue but it wasn't related to Firebug. If there is an tag on your page with no src (or possibly an invalid source? I haven't confirmed this) then Firefox issues a GET request after the POST. For me it was an issue with a pixel image that was supposed to be generated from a 3rd party script. Disabling the script fixed the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants