bolt form success fails

Open
#202 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
php, symfony
Domain
backend

Research direction

Start by reviewing boltforms/src/Submission/Result.php and the SUBMISSION_POST_PROCESSOR handling, then compare it with the feedback configuration in boltforms.bolt.yml. Reproduce the valid submission using join_page_form.twig and boltforms('join') with success and redirect feedback; done means the template renders without the invalid-result Twig exception.

Written by the indexing model from the issue text.

Description

I have bolt form with post processing on BoltFormsEvents::SUBMISSION_POST_PROCESSOR.
Forms show correctly, its correctly validated, if not valid correct messages show but if form is valid it fails just after mine post processing.
I've tried with feedback.success and feedback.redirect both fails the same way:

Uncaught Exception: Twig_Error_Runtime .

Twig_Error_Runtime in Template.php line 447:
An exception has been thrown during the rendering of a template ("Attempted to access invalid result: boltforms.submission_post_processor") in "main-pages/join_page_form.twig" at line 6.

join_page_form.twig:

<div>
    {{ boltforms('join') }}
</div>

boltforms.bolt.yml:

join:
  notification:
    enabled: false
  feedback:
    success: Thank you!
    error: There are errors in the form, please fix before trying to resubmit
    redirect:
        target: page/thank-you
  templates:
    form: boltforms\join_form.twig
  fields:
...

It doesn't seem that boltforms/src/Submission/Result.php work with SUBMISSION_POST_PROCESSOR.
Please advice if its my error in config or issue with bolt forms and how to deal with it.

Versions:
bolt/bolt: v3.3.6
bolt/boltforms: v4.1.13

Dominant language
PHP
Stars
52
Forks
54
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bolt/boltforms

All issues in bolt/boltforms

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.