smcmahon/Products.PloneFormGen — Issue #35: Querystring is lost after submitting
Author: WouterVH
Created: 2012-02-22 15:09:12+00:00
State: open

PFG 1.7.0 on Plone 4.1.10:
I have a form that varies depending on a url-parameter,
but this querystring is lost returning to the form when validation fails

my_form?code=AA
submitting, but with errors
redirects to my_form

Fix in form.py
---------
def fgGetFormSubmitAction(self):
...

action = self.REQUEST.other.get('pfg_form_action')
if not action:
action = getattr(self, 'formActionOverride', None)
if not action:
if self.REQUEST['QUERY_STRING']: # WVH
action = "%s?%s" % (self.absolute_url(), self.REQUEST['QUERY_STRING']) # WVH
else: #WVH
action = self.absolute_url()

...