I created a custom block type for Contact forms, and added an instance with a webform. When trying to save the node, it indicates that I have to fill out the required fields for the embedded form.

If you actually fill out the form and hit Save, the form is submitted, but the node is not saved.

Comments

perandre created an issue. See original summary.

perandre’s picture

Title: Adding a webform custom block with required fields prevents node save » Adding a webform custom block prevents node save

  • marcofernandes committed 4079924 on 8.x-1.x
    #3021675 by perandre: Add required=false and readonly = true to form...
marcofernandes’s picture

Status: Active » Needs review
marcofernandes’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kszarek’s picture

Hi guys! The problem still occurs, steps to reproduce:
1. Create new block type.
2. Create reference field to webform entity.
3. Enable block in content type that uses gutenberg.
4. Add drupal block on node create - it renders with success.
5. Click save button - page is being reloaded without node save - failure.

sayco’s picture

Status: Closed (fixed) » Needs work

kszarek thank you, for reporting the issue. It seems that the issue is still applicable, I'm reopening the issue.
Feel free to provide a patch if you know how to solve it.

kszarek’s picture

Note: temporary solution is to save node with having opened Gutenberg editor as a Code editor

marx009’s picture

StatusFileSize
new53.66 KB

Hi guys! Comparison of the POST data shows that form data of the inner form (webform) are added to the node edit form data including the form_id, form_token and form_build_id.

The left part on the image shows the POST data before the switch to Code editor and back to Visual editor. The right part is the situation after the switch.

webform in gutenberg post data comparison

Hope it helps.

marx009’s picture

The problem could be solved by adding property "disabled" of inner form elements to true. So it's just little update of #3

Problem of the proposed solution is the appearence of such form elements as they inherit the disabled styling (buttons included).

I'll post the patch soon.

marx009’s picture

Status: Needs work » Needs review
StatusFileSize
new912 bytes

Patch that disables form elements inside Drupal block.

marcofernandes’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.