AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
832 stars 169 forks source link

Repeater block in Gutenberg Block not copying correctly #536

Open chrisjreber opened 3 years ago

chrisjreber commented 3 years ago

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?

lgladdy commented 3 years ago

@chrisjreber Hey Chris, Thanks for the report. What version of ACF were you using when you encountered this issue? We've had a report of a bug introduced 5.10, so want to confirm if this could be related.

chrisjreber commented 3 years ago

@lgladdy It's the older version v5.9.9

margarita-boomCodes commented 2 years ago

@lgladdy Hello!

I can also reproduce this error on the latest 5.12 Pro Version. The only differences is that I didn't have any pattern, but the ACF-Block with the repeater field was 3-level nested into other Blocks. If it's nested only 1-level, it worked fine.

Also the workaround @chrisjreber mentioned above, doesn't work for me.

lgladdy commented 2 years ago

@margarita-boomCodes Hey! We're aware of this issue. We're working we resolve it in an update in the next week or so! I'll let you know when I have more info.

margarita-boomCodes commented 2 years ago

@lgladdy I just wanted to confirm that the latest update 5.12.1 solved the bug. Thank you for the super fast fix!

lgladdy commented 2 years ago

@chrisjreber I'm pretty sure your issue is separate to the bug we fixed in ACF 5.12.1, but could you confirm the issue is still present for you in ACF 5.12.1?