AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
871 stars 182 forks source link

Block fields unresponsive in converted reusable block #308

Open matbrady opened 4 years ago

matbrady commented 4 years ago

Problem

ACF block fields are not consistently initialized after converting a Reusable Block to a Regular Block. This issue does not always occur. Since core block still seem to work, my guess was it is an ACF issue.

Example

Steps to reproduce

  1. Insert a reusable block which includes ACF Block fields (Reusable block outline below)
  2. Convert the reusable block to a Regular Block

Reusable Block JSON

{
  "__file": "wp_block",
  "title": "Person Listing",
  "content": "<!-- wp:group {\"backgroundColor\":\"blue-light\",\"textColor\":\"gray-dark\"} -->\n<div class=\"wp-block-group has-blue-light-background-color has-gray-dark-color has-text-color has-background\"><div class=\"wp-block-group__inner-container\"><!-- wp:heading -->\n<h2>Meet the faces of EDI</h2>\n<!-- /wp:heading -->\n\n<!-- wp:columns -->\n<div class=\"wp-block-columns\"><!-- wp:column -->\n<div class=\"wp-block-column\"><!-- wp:acf/person {\n    \"id\": \"block_5ebc6bf81299d\",\n    \"name\": \"acf\\/person\",\n    \"data\": {\n        \"person\": 899,\n        \"_person\": \"field_5ebc0df79263f\"\n    },\n    \"align\": \"center\",\n    \"mode\": \"edit\"\n} /--></div>\n<!-- /wp:column -->\n\n<!-- wp:column -->\n<div class=\"wp-block-column\"><!-- wp:acf/person {\n    \"id\": \"block_5ebc6bf81299e\",\n    \"name\": \"acf\\/person\",\n    \"data\": {\n        \"person\": 849,\n        \"_person\": \"field_5ebc0df79263f\"\n    },\n    \"align\": \"center\",\n    \"mode\": \"edit\"\n} /-->\n\n<!-- wp:paragraph -->\n<p></p>\n<!-- /wp:paragraph --></div>\n<!-- /wp:column --></div>\n<!-- /wp:columns --></div></div>\n<!-- /wp:group -->"
}

Block Outline

Person being the ACF Block

Screenshot 2020-05-29 15 11 10

Similar Issue

183

elliotcondon commented 4 years ago

Hi @matbrady

Thanks for the bug report. We are aware of a few issues affecting reusable ACF Blocks, and this example will be very helpful in replicating the issue.

I've added this to our to-do list for version 5.9

elliotcondon commented 4 years ago

Hi @matbrady

Just an update on this issue. I've been working my way through a few issues regarding Reusable Blocks, but haven't yet been able to replicate this one. I wonder if I have inadvertently fixed it during some recent improvements.

I hope you don't mind, but I've sent an invite to join the ACF PRO testers group. This group has access to the private ACF PRO repository where you can download the latest development version. If you accept the invite, please pull down the "feature/release-5-9" branch. This contains the latest code during the 5.9 development cycle.

Please let me know if the problem persists, and we can continue to test.

matbrady commented 4 years ago

Hi @elliotcondon, happy to test. I did not notice an invite though.

elliotcondon commented 4 years ago

@matbrady Just checked GitHub and can confirm the invite is pending for "matbrady". Everything looks good on our end, can you check your email spam?

matbrady commented 4 years ago

@elliotcondon AH found it but of course it's now expired. If you able to resend today I'm able to test.

Screenshot 2020-07-01 11 55 01
elliotcondon commented 4 years ago

Invite resent 👍