bolt / bolt/boltforms

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

Open
#217 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.