The same with me. There are many empty paragraphs in the output of the form and the layout is broken.
Same thing here.
Please replace /wp-content/plugins/contact-form-7/includes/block-editor/block.json with this content: (or just edit line 34: “editorScript”: “./index.js”)
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"name": "contact-form-7/contact-form-selector",
"title": "Contact Form 7",
"category": "widgets",
"description": "Insert a contact form you have created with Contact Form 7.",
"keywords": [ "form" ],
"textdomain": "contact-form-7",
"attributes": {
"id": {
"type": "integer"
},
"title": {
"type": "string"
},
"htmlId": {
"type": "string"
},
"htmlName": {
"type": "string"
},
"htmlTitle": {
"type": "string"
},
"htmlClass": {
"type": "string"
},
"output": {
"enum": [ "form", "raw_form" ],
"default": "form"
}
},
"editorScript": "./index.js"
}
I’m having the same issue. I have a bunch of HTML in my form output (divs, p, etc) and now everything is getting extra p tags and br tags creating spaces where I don’t want them. Is hacking the plugin the only option?
Thanks for your help.
BTW, that change didn’t help me. I’m using the shortcode in the classic editor and in php template files.
-
This reply was modified 3 years, 5 months ago by
jberg1.
Same problem here..many empty paragraphs in the output of the form and the layout is broken.
About the register_block_script_handle error
The temporary fix is here : https://ww.wp.xz.cn/support/topic/error-after-last-update-48/
- On your server, open this file
/wp-content/plugins/contact-form-7/includes/block-editor/block.json
- On line 34 replace
"editorScript": "file:./index.js" by "editorScript": "./index.js"
Note that this is a temporary fix while waiting the next update which, hopefully, will definitively fix the problem.
About the added <p> tags
This occurs because CF7 now adds <p> tag on every line return.
You can disable this behaviour :
- open your
wp-config.php file in the WordPress root installation directory.
- add a line with
define('WPCF7_AUTOP', false ); in the beginning of the file.
WPCF7_AUTOP is an official constant of CF7, you can learn more here : https://contactform7.com/controlling-behavior-by-setting-constants/
@kiwifraise his solution worked for us
Thanks Vanoisbe,
Your solution for editing wpconfig worked for me.