Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form block inside FSE "On Submission" actions not working #22696

Closed
ezebecke opened this issue Jan 20, 2022 · 7 comments · Fixed by #25278
Closed

Form block inside FSE "On Submission" actions not working #22696

ezebecke opened this issue Jan 20, 2022 · 7 comments · Fixed by #25278
Assignees
Labels
[Block] Contact Form Form block (also see Contact Form label) Build Maintenance Build Group maintenance tasks Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@ezebecke
Copy link

Quick summary

Forms have three optional actions "on submission"

  • Show summary of submitted fields
  • Show a custom text message
  • Redirect to another page

None of them seem to work when adding this block inside an FSE template.

Steps to reproduce

1- Add Form block to template
2- Test live form with any selection "on submission" option

What you expected to happen

The form should display a custom message, redirect, or show submitted fields after submitting.

What actually happened

Page refreshes and email is sent, but the "on submission" action doesn't happen.

Context

Tested on my own Atomic site.

Simple, Atomic or both?

Atomic

Theme-specific issue?

No response

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

No response

Available workarounds?

No response

Workaround details

Adding the Form block on a page.

@ezebecke ezebecke added [Type] Bug When a feature is broken and / or not performing as intended User Report labels Jan 20, 2022
@Greatdane
Copy link

Can reproduce on WordPress.com sites and self-hosted sites

As this is a Jetpack block at heart, will transfer to the Jetpack repo.

@Greatdane Greatdane transferred this issue from Automattic/wp-calypso Feb 7, 2022
@Greatdane Greatdane added [Block] Contact Form Form block (also see Contact Form label) [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg labels Feb 7, 2022
@Greatdane
Copy link

Another report here; 36093109-hc

Looks like only certain templates. (I could reproduce on Single Item templates)

@matticbot matticbot added the Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" label Jul 23, 2022
@jeherve
Copy link
Member

jeherve commented Jul 25, 2022

cc @danielbachhuber who worked on #24727.

@danielbachhuber
Copy link
Contributor

@Greatdane Would you be able to provide full reproduction steps? Thanks!

@jeherve jeherve added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jul 25, 2022
@Greatdane
Copy link

Greatdane commented Jul 26, 2022

Sure @danielbachhuber

  1. Create a new template in FSE
  2. Add a form block
  3. On the form settings, choose redirect on submission and choose a URL
  4. Save!

When you visit the page and submit the form, it does not redirect

Here is a video of it in action;

N9YBlq.mp4

@danielbachhuber danielbachhuber added Build Maintenance Build Group maintenance tasks and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jul 26, 2022
@danielbachhuber danielbachhuber self-assigned this Jul 26, 2022
@danielbachhuber
Copy link
Contributor

@Greatdane Thanks! Your additional details are very helpful — I didn't even know that feature existed 😅

Interestingly, this works in my local environment with the latest version of Jetpack and Gutenberg:

image

CleanShot.2022-07-26.at.07.19.26.mp4

However, I can reproduce the bug in the Atomic environment I created for the occasion:

CleanShot.2022-07-26.at.07.38.54.mp4

The underlying issue is that Atomic is using a gutenberg/lib/compat/wordpress-5.9/template-canvas.php fallback template. Here's a fix for it #25278

@Greatdane
Copy link

Greatdane commented Jul 27, 2022

Awesome, thanks for the quick fix @danielbachhuber! ABSPATH strikes again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) Build Maintenance Build Group maintenance tasks Customer Report Issues or PRs that were reported via Happiness. aka "Happiness Request", or "User Report" [Focus] FSE Issues related to the site editor / Full Site Editing / FSE feature in Gutenberg [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants