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

ISNBAT render a Form which returns errors #1653

Closed
4 tasks done
AnthonyLedesma opened this issue Aug 28, 2020 · 2 comments · Fixed by #1643
Closed
4 tasks done

ISNBAT render a Form which returns errors #1653

AnthonyLedesma opened this issue Aug 28, 2020 · 2 comments · Fixed by #1643
Labels
[Priority] Low This issue/pull request is not immediate [Status] Needs Info Tracking issues with follow-up required in order to be actionable [Type] Bug Something that is not working as expected
Milestone

Comments

@AnthonyLedesma
Copy link
Member

Describe the bug:

Using the following markup we can generate a form within the editor. When puslished and filled from the front-end we are seeing error messages.

<!-- wp:coblocks/form -->
<!-- wp:coblocks/field-name /-->

<!-- wp:coblocks/field-email {"required":true} /-->

<!-- wp:coblocks/field-radio {"options":["Option"]} /-->

<!-- wp:coblocks/field-select {"options":["Option"]} /-->

<!-- wp:coblocks/field-radio {"options":["Option"]} /-->

<!-- wp:coblocks/field-textarea {"required":true} /-->

<!-- wp:coblocks/field-submit-button {"submitButtonText":"Contact Us"} /-->
<!-- /wp:coblocks/form -->

Errors

Notice: Undefined index: value in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 887

Notice: Undefined index: value in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 893

Notice: Undefined index: label in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 893

Notice: Undefined index: value in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 887

Notice: Undefined index: value in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 893

Notice: Undefined index: label in /Users/aledesma/development/wordpress/wp-content/plugins/coblocks/includes/class-coblocks-form.php on line 893

To reproduce:

  1. Generate the block by copy/pasting the markup provided above.
  2. Publish post and view page from front-end.
  3. Complete form and submit.
  4. See error.

Expected behavior:

Expect improperly setup blocks not to render on front-end.
Expect improperly blocks setup within form show an error to end-user specifying what is wrong.

Isolating the problem:

  • This bug happens with no other plugins activated
  • This bug happens with a default WordPress theme active
  • This bug happens without the Gutenberg plugin active
  • I can reproduce this bug consistently using the steps above

WordPress version:

5.5

Gutenberg version:

None

@AnthonyLedesma AnthonyLedesma added [Type] Bug Something that is not working as expected [Priority] Low This issue/pull request is not immediate labels Aug 28, 2020
@EvanHerman
Copy link
Contributor

@AnthonyLedesma I think I actually resolved this one in #1643 with this line:
https://github.com/godaddy-wordpress/coblocks/pull/1643/files#diff-6d80ae73598914e98038e94039011848R479

We were specifying an incorrect value there and the label/value pair in the global $_POST array wasn't returning properly.

@richtabor
Copy link
Contributor

@AnthonyLedesma Can you confirm this when you have an opportunity?

@richtabor richtabor added the [Status] Needs Info Tracking issues with follow-up required in order to be actionable label Sep 3, 2020
@AnthonyLedesma AnthonyLedesma linked a pull request Sep 3, 2020 that will close this issue
5 tasks
@jrtashjian jrtashjian added this to the Next Release milestone Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Priority] Low This issue/pull request is not immediate [Status] Needs Info Tracking issues with follow-up required in order to be actionable [Type] Bug Something that is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants