AdvancedCustomFields / AdvancedCustomFields/acf

Repeater block in Gutenberg Block not copying correctly

Open
#536 6 comments 0 reactions 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

Found this odd bug when using a Gutenberg block with ACF repeater fields in a Gutenberg Pattern.

This bug has something to do with copying a Gutenberg block with a repeater field onto the same page. If you copy a Gutenberg block with an ACF repeater field and paste it onto the same page then try and change the contents of the repeater fields. It looks like it's changing on the admin editor side, but the front end doesn't change and if you refresh the page all your changes are lost.

This typically wouldn't be an issue but when this repeater field block is in a Gutenberg Pattern it also causes the same issue.

Steps to replicate:

  1. Create an ACF block with a repeater field
  2. Add ACF repeater block to the page and save
  3. Add demo content to ACF repeater block
  4. Click more settings on the ACF repeater block and Copy block
  5. Paste this copied block onto the page
  6. Change the contents of this copied block, it will look like you are changing contents in the admin
  7. Click save and view the front end
  8. All your changes to the copied block are lost

Workaround:
After copying a Gutenberg block or a Gutenberg Pattern that includes an ACF repeater to a page you need to save the page and then refresh the page BEFORE changing anything in the repeater fields.

Any ideas what could be causing this or how can I fix this?

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 with the listed reproduction steps in a WordPress Gutenberg editor using an ACF repeater block, then inspect the copied block's save and front-end behavior. Done means a copied repeater block can be edited, saved, refreshed, and display the changed values without the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.