AdvancedCustomFields / acf

Advanced Custom Fields
http://advancedcustomfields.com/
835 stars 171 forks source link

Compatibility issues with WP 6.2 beta1 #787

Open nick6352683 opened 1 year ago

nick6352683 commented 1 year ago

I just started testing WP 6.2 beta1. Right away:

  1. The ACF Blocks in Edit mode are broken, the Preview mode is ok.

  2. This is not new, but I don't think anyone has mentioned it before, the same thing as issue 1 happens with the Site Editor, with 2 distinctions: The first one is that the Edit mode button never shows up, BUT, in the inspector (right sidebar), the columns set in the Field group do not break into a single column, which makes things very difficult. My so far solution was to configure my ACF Blocks in a temp. page, and then simply copy them to the Site Editor.

  3. Side note: This is not related to ACF PRO, but I'm finding that many other plugins and themes are getting broken with just 10 minutes of testing: The Wayfinder plugin no longer works, as a backup I had the Block Guide Lines to use from the EditorsKit plugin, both of these solutions no longer work, so I'm left with the white space to guess where to click to select an element, of course we have the breadcrumbs and the block Navigation menus. Also there are things that are breaking my FSE theme, like I no longer have a Sticky header, instead I have some extra paddings. Disabling the Sticky header option the extra padding seem under control, but I have to come up with a new sticky header solution. The bottom line for the 3rd point is that test all your plugins and themes that you use...

mattgrshaw commented 1 year ago

Thanks for the heads up @nick6352683, we'll be looking into this further and releasing updates as necessary.

CreativeDive commented 1 year ago

@nick6352683 for testing I've updated to the latest 6.2 beta too. But I can't confirm that ACF blocks are broken in edit mode. Do you can describe what is broken please?

Actually I thought the 6.2 version will use the post block editor embedded in an iframe according to https://github.com/WordPress/gutenberg/pull/46212. But it's still not the case.

nick6352683 commented 1 year ago

Sorry for the delay... I have a video... I have to add that the blocks are registered with php and not json. I'm running the latest version of ACF Pro, and using my own coded hybrid theme (FSE theme with the classic menus, widgets screen and customizer).

https://www.youtube.com/watch?v=WV054DtqR4A

lgladdy commented 1 year ago

Hey @nick6352683,

We're aware of this issue and are working on figuring out our way forward on this at the moment. It only affects certain themes at the moment; but I'm still trying to figure out the trigger. I suspect it's to do with themes which use html templates.

It affects twentytwentytwo and three, but not one for example.

The bad news is, my current thinking for how to fix this will require your blocks to be upgraded to v2, as we might have to manually add ACF's JS and CSS scripts as editorStyles and editorScripts for the block (and we can only do that for block.json registered blocks); but that still doesn't actually solve all the issues.

Still, we'll have more info on this soon now we're able to dig into the 6.2 beta

lgladdy commented 1 year ago

@nick6352683 For now, as a workaround; if you add a Metabox to the page WordPress won't use the iFrame; so you can just add a blank field group to the post types you're using ACF Blocks on.

nick6352683 commented 1 year ago

I want to thank all of you who commented here from the bottom of my heart !!! Adding metaboxes not only solved my ACF Block issues but also all the other unrelated to ACF issues.

That said, is anything to be done about the site editor? I am almost certain we cannot have metaboxes there, and as I mentioned in the video, the Edit Mode button is missing, and in the right sidebar (inspector) the Field Groups fields do not break down into a single column. As a mentioned, my workaround was to develop my templates in a temp. page/post and migrate the blocks manually to the site editor templates...

Again, thanks everyone for all your help !

lgladdy commented 1 year ago

Quick update for everyone here. We're working with the WordPress team who are building a back compatibility system for blocks which can't work inside the iframe.

This only affects ACF's edit mode for ACF Blocks as things like select2 and date picker scripts are unable to inject their overlays inside the iframe.

Longer term, we'll need to move ACF's edit mode out of the actual block and into something like a modal. But we'll focus on making sure we're good to go with WP6.2 at release for now.

CreativeDive commented 1 year ago

@lgladdy it seems this task is no longer included in the WP 6.2 editor tasks https://github.com/orgs/WordPress/projects/63/views/1

Does that mean there won't be a fix in 6.2 for now?

CreativeDive commented 1 year ago

@lgladdy A note for you in case you don't already know https://github.com/WordPress/gutenberg/pull/48076.

The best way forward seems to use the block api version to check compatibility. For the next release, we will iframe the post editor only if all blocks in the library are api version 3 or higher.

It seems we have to update all the blocks to v3 to get the iframed post editor in the future.

CreativeDive commented 1 year ago

@lgladdy As a note, I don't know why and if that's expected. In WP 6.2 stable the editor is loaded without an iframe. But when the Gutenberg plugin is enabled, the iframe is still there even though it shouldn't load. Since the iframe can now only be loaded if the blocks v3.