AdvancedCustomFields / AdvancedCustomFields/acf

Inconsistent output of serialized gutenberg acf block in post content

Open
#192 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm the author of https://github.com/pristas-peter/wp-graphql-gutenberg and https://github.com/pristas-peter/wp-graphql-gutenberg-acf plugins, which parse gutenberg blocks on post save and then generate the graphql schema for them.

I have started using acf blocks (pro), but have found bug, when the output of the block is saved differently to post content html when the block is edited and when it is not, which makes it difficult to use in my plugin.

Here is the example output of the same block when it is edited and when it is not:

<!-- wp:acf/banner-carousel {"id":"block_5ce074fe8acd9","name":"acf/banner-carousel","data":{"items_0_image":301,"_items_0_image":"field_5ce06b616c1fa","items_0_link":{"title":"Indexa","url":"https://google.com/","target":""},"_items_0_link":"field_5ce06c0b6c1fd","items_1_image":302,"_items_1_image":"field_5ce06b616c1fa","items_1_link":{"title":"Indexa","url":"https://google.com/","target":"_blank"},"_items_1_link":"field_5ce06c0b6c1fd","items_2_image":300,"_items_2_image":"field_5ce06b616c1fa","items_2_link":{"title":"Index","url":"https://google.com/","target":"_blank"},"_items_2_link":"field_5ce06c0b6c1fd","items":3,"_items":"field_5ce06b516c1f9","products":44,"_products":"field_5cf8c0ef0817d"},"mode":"edit"} /-->
<!-- wp:acf/banner-carousel {"id":"block_5ce074fe8acd9","name":"acf/banner-carousel","data":{"field_5ce06b516c1f9":{"row-0":{"field_5ce06b616c1fa":"301","field_5ce06c0b6c1fd":{"title":"Indexa","url":"https://google.com/","target":""}},"row-1":{"field_5ce06b616c1fa":"302","field_5ce06c0b6c1fd":{"title":"Indexaaaa","url":"https://google.com/","target":"_blank"}},"row-2":{"field_5ce06b616c1fa":"300","field_5ce06c0b6c1fd":{"title":"Index","url":"https://google.com/","target":"_blank"}}},"field_5cf8c0ef0817d":"44"},"mode":"edit"} /-->↵↵

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the two serialized ACF block examples and reproducing the difference between an edited and an unedited block. Done means the block’s post-content serialization is consistent in both cases, but the issue does not name files, tests, or a specific implementation entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.