AdvancedCustomFields / AdvancedCustomFields/acf

Reusable block doesn't change ID when you "Convert to regular blocks"

Open
#478 7 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

I've hit a strange issue that I've partially narrowed down. Here is the scenario where we've had it break in a few places.

We have a "Recent Posts" type block with a bunch of "WP_Query" related settings.

1: Create a reusable block with your ACF block (we save and refresh).
2: Duplicate the block below on the page.
3. Convert the 2nd instance to regular blocks via the core UI toolbar button.
4. Save and view page.

When we view the page (and the page source) the block ID block_6064a250ed142 is the same on the reusable block and the newly converted regular block. This causes rendering of the 2nd block to use the settings from the first and we end up with identical blocks on the page.

If I manually change block_6064a250ed142 to something different like block_6064a250ed143 (3 at the end instead of 2) then everything displays correctly.

Let me know if anyone else can recreate 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

Reproduce the issue with an ACF reusable block, a duplicated instance, and the core “Convert to regular blocks” toolbar action, then inspect how the block ID is retained during conversion and rendering. Done means the converted block receives a distinct ID and both blocks render with their own settings; add or update a regression test if the relevant test location is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.