Hello. We have a bug when working with Gutenberg sides with ACF fields.
WordPress: 6.5.5
Apache: 2.4.61
PHP: 8.1.29
Advanced Custom Fields PRO: 6.3.9
Gutenberg blocks are registered via block.json and register_block_type. Fields for the block are added via ACF.
The problem:
Sometimes when I add a block in the editor, the data for it does not load.
This is what a block added for the first time should look like:
<!– wp:vp-swan/gallery {“name”:”vp-swan/gallery”,”data”:{“field_66f28000f6c68″:””,”field_66c196c31255b”:”1″,”field_66bcecc968768″:{“row-0”:{“field_66bcecdf68769″:””,”field_66bcecec6876a”:””}}},”mode”:”edit”} /–>
But very often the block is added like this:
<!– wp:vp-swan/gallery {“name”:”vp-swan/gallery”,”data”:{},”mode”:”edit”} /–>
The most interesting thing is that the block in the visual editor looks normal, and I can add data there. But after saving, the data is not saved and is lost.
I also noticed that this happens because when adding a block, there is no request to admin-ajax.php with action:acf/ajax/fetch-block, which is probably why the data is not loaded.