WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.51k stars 4.21k forks source link

Site Editor: The static homepage with the Front Page template that doesn't have the post content displays nothing #53264

Closed arthur791004 closed 1 year ago

arthur791004 commented 1 year ago

Description

Referring to https://github.com/Automattic/wp-calypso/issues/79224, the site editor might display nothing when

  1. The “Your homepage displays” setting is configured to a static page
  2. The theme has a front-page.html or the user created a front-page template
  3. The front-page template contains only patterns

The reason is the registered patterns/blocks are filtered out via the canInsertBlockType function because the block editing mode is disabled, and it's disabled due to useDisableNonPageContentBlocks

Step-by-step reproduction instructions

  1. Install and activate the themes below
  2. Go to Settings > Reading, and configure “Your homepage displays” to a static page
  3. Go to Appearance > Editor
  4. Ensure the preview displays nothing

Screenshots, screen recording, code snippet

image

Environment info

The latest trunk on 2 Aug

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Mamaduka commented 1 year ago

I think this was fixed in #53169. The fix will ship with Gutenberg 16.4.

annezazu commented 1 year ago

This seems to match what was reported here by @wpsoul https://github.com/WordPress/gutenberg/issues/52388#issuecomment-1660849268

tellthemachines commented 1 year ago

Install and activate the Kigen theme

@arthur791004 that theme doesn't seem to be available in the WP theme directory. Could you share it as a zipped folder or, alternatively, point to a publicly accessible theme where the issue can be reproduced? You could also create a dummy theme with just the minimal code required to reproduce.

arthur791004 commented 1 year ago

Here it is: https://public-api.wordpress.com/rest/v1/themes/download/kigen.zip

arthur791004 commented 1 year ago

I think this was fixed in https://github.com/WordPress/gutenberg/pull/53169. The fix will ship with Gutenberg 16.4.

I guess it's slightly different since I tested it using the latest trunk yesterday and the issue is still there 🤔

tellthemachines commented 1 year ago

Thanks!

I can't reproduce the issue on the latest Gutenberg trunk or on WP 6.3 RC3 with the Kigen theme:

Screenshot 2023-08-03 at 4 26 35 pm

Could you try testing also on WP 6.3 RC without Gutenberg enabled?

arthur791004 commented 1 year ago

I tried again and it works now.

So, I expect this issue would be resolved with Gutenberg 16.4.0 🎉

tellthemachines commented 1 year ago

Thanks for checking! Closing as fixed by https://github.com/WordPress/gutenberg/pull/53169.