Automattic / Automattic/jetpack
Contact form: Converting form shortcode to a block does not include form field shortcodes
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
The support for the conversion of shortcodes into blocks seems quite limited compared to the conversion of blocks between different types, even if it uses the same API.
This means that shortcodes nested inside others — in our cases form fields inside of a contact form — cannot be parsed properly by Gutenberg. Currently, defaults from the `JetpackContactForm` component found in `jetpack-contact-form.jsx` are used, which essentially sets each form block to a default state, replacing any user-defined field.
The Gutenberg API documentation does not explicitly indicate the limitation of shortcode conversions. I do think it should be a bit clearer on that, if this is not possible to do.
A PR for the WIP and R&D is at https://github.com/Automattic/wp-calypso/pull/28611
An issue ticket has been created within Gutenberg related to this at https://github.com/WordPress/gutenberg/issues/12235
Contributor guide
Research direction
Start with jetpack-contact-form.jsx and the Gutenberg shortcode-to-block conversion API documentation, then review wp-calypso PR 28611 and Gutenberg issue 12235. Confirm whether nested form-field shortcodes can be preserved; done means user-defined fields survive conversion or the API limitation is clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, wordpress
- Domain
- content, frontend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100