AdvancedCustomFields / AdvancedCustomFields/acf
Editing ACF blocks in the canvas broken in WordPress 6.8 with FSE themes
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
In WordPress 6.8 (currently in RC 1), there was a change that forces blocks to be iframed if the theme is a block theme. In WordPress 6.7 and prior, even block themes would disable the iframe when it detected blocks registered with a v2 (ACF blocks are registered as v2 in the latest versions and schemas). So when using a block theme and ACF blocks, the JS/CSS isn't loaded properly into the canvas and breaks the editing experience.
To Reproduce
Steps to reproduce the behavior:
- Install the latest version of WordPress as of this filing (6.8-rc1)
- Make sure your site has the WordPress 2023 theme available in the themes folder
- Download the sample block from https://www.advancedcustomfields.com/wp-content/uploads/2023/08/tt3child.zip
- Activate this child theme which comes with the testimonial block
- Add the testimonial block to a page and try to edit the fields in edit mode, where they show up in the canvas.
Expected behavior
The CSS/JS should be properly loaded for the block, instead it is a broken experience.
Screenshots or Video
Version Information:
- WordPress Version 6.8-rc1
- PHP Version 8.1.23
- ACF Version 6.3.12
- Browser Chrome (latest)
Additional context
This is due to a change made here: https://github.com/WordPress/gutenberg/pull/66800 where it was decided to get much more aggressive in how the block iframe was determined it should be used.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with WordPress 6.8-rc1, the WordPress 2023 theme, and the linked tt3child.zip sample block. Read the linked Gutenberg PR 66800 and trace how ACF blocks are handled when the canvas is iframed. Done means the testimonial block's CSS and JavaScript load correctly and its fields can be edited in the canvas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100