Support

Account

Home Forums Gutenberg Empty data in Gutenberg block (“data”:{})

Solving

Empty data in Gutenberg block (“data”:{})

  • 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.

  • Hi. I have the same problem on 5 of my sites.

    Wordpress: 6.6.2
    ACF PRO: 6.3.10
    PHP: 8.3.12

  • Hello,

    I am facing the same issue. Are you able to find any solution for this @andrii-bomatsara @daniel-pimenta

  • We’re also encountering this issue on a number of websites running the latest versions of WordPress, ACF and PHP 8.2 and above.

    Has anyone been able to resolve?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.