boltforms icon indicating copy to clipboard operation
boltforms copied to clipboard

[BUG] Results are set to false after successful form submission

Open JarJak opened this issue 8 years ago • 0 comments

Steps to reproduce:

  1. Dump result arrray in form template
  2. Submit form with correct data
  3. See dumped result

Expected result:

Returned result is filled with information about what happened during form processing. I can use this information as explained in https://github.com/bolt/boltforms/blob/4.1/templates/form/form.twig#L7

Actual result:

All results are set to false, so https://github.com/bolt/boltforms/blob/4.1/templates/form/form.twig#L40 this never happens as result.pass('email') is always false, even with correct form submission. Therefore, comment line at https://github.com/bolt/boltforms/blob/4.1/templates/form/form.twig#L7 is not true as result array is always false.

Caused by:

Form after submission (with POST) gets redirected to same page (with GET) in src/Submission/Processor/Redirect.php:90 but this happens before updated Result is returned to user in src/Submission/Processor.php:163

Also feedback.redirect is not configured in my case.

What helped:

Commenting out lines 88-92 in file src/Submission/Processor/Redirect.php worked out for me, but I am sure there is a better solution.

I am not against redirecting after submission, but the result should be kept, for example as flash messages.

JarJak avatar Nov 20 '17 13:11 JarJak