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

Forms: variations with radio option field have empty default values #41500

Open
simison opened this issue Feb 3, 2025 · 1 comment · May be fixed by #41501
Open

Forms: variations with radio option field have empty default values #41500

simison opened this issue Feb 3, 2025 · 1 comment · May be fixed by #41501
Assignees
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms [Pri] Normal [Status] Auto-allocated [Status] In Progress Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@simison
Copy link
Member

simison commented Feb 3, 2025

Reported in #41245 (comment)

In several variations (RSVP, feedback, appointment) there are radio fileds. When using these patterns, those fields are empty even if in code we have the example values defined.

Variations can be added via placeholder block, or via sidebar:

Image Image

Current code:

[
'jetpack/field-radio',
{
label: __( 'Time', 'jetpack-forms' ),
required: true,
options: [ __( 'Morning', 'jetpack-forms' ), __( 'Afternoon', 'jetpack-forms' ) ],
},
],

<!-- wp:jetpack/field-radio {"label":"Time","required":true,"options":["Morning","Afternoon"]} /-->

Result currently

Image

With code:

<!-- wp:jetpack/field-radio {"label":"Time","required":true,"options":["Morning","Afternoon"]} -->
<div class="wp-block-jetpack-field-radio"><!-- wp:jetpack/field-option-radio /--></div>
<!-- /wp:jetpack/field-radio -->

Expected result

Image

With code:

<!-- wp:jetpack/field-radio {"label":"Time","required":true} -->
<div class="wp-block-jetpack-field-radio"><!-- wp:jetpack/field-option-radio {"label":"Morning"} /-->

<!-- wp:jetpack/field-option-radio {"label":"Afternoon"} /--></div>
<!-- /wp:jetpack/field-radio -->
@simison simison added [Type] Bug When a feature is broken and / or not performing as intended [Pri] Normal [Block] Contact Form Form block (also see Contact Form label) [Package] Forms [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. labels Feb 3, 2025
@simison simison linked a pull request Feb 3, 2025 that will close this issue
3 tasks
@janmckell
Copy link

📌 STEPS

  1. Add a RSVP, Appointment or Feedback Form Block to a page.
  2. It may come pre-populated with a 'Radiobox' field, which has no options set
  3. It also comes with that radiobox field pre-selected as 'Required'
  4. If the user does not change that setting to 'Not Required' or removed the radiobox, their email is not sent
  5. If the user sets the field as 'Not Required' but still does not remove the radiobox field, it may be hidden from view on the page, but is shown in the email that is received. In this case, the email is sent.

📌 REPRODUCTION RESULTS
– Tested on Simple – Replicated
– Tested on Atomic – Replicated

  • Jetpack Form feature

📌 FINDINGS/SCREENSHOTS/VIDEO
Screenshot for form shows send message and is actually sent, only when the radiobox is not set as required, if there are no options inserted.

Image

This is a blocking bug, since the user won't know that this is the reason their forms aren't being sent, and has no way to identify that as a root cause.

There should be a warning for any field they set as 'Required' which subsequently does not prompt them to set options for those fields - otherwise, they should remove them and be told that not doing so, would stop their form from being sent.

📌 ACTIONS
– Set as Blocker

📌 Message to Author
Could you confirm that this is your finding ? @simison

@janmckell janmckell moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Feb 3, 2025
@jeherve jeherve added the Triaged label Feb 4, 2025
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) [Feature] Forms Blocks Blocks designed to streamline user input and engagement, such as contact, newsletter sign-ups, etc. [Package] Forms [Pri] Normal [Status] Auto-allocated [Status] In Progress Triaged [Type] Bug When a feature is broken and / or not performing as intended
Projects
Development

Successfully merging a pull request may close this issue.

4 participants