WordPress / gutenberg

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

Multiple PHP and HTML homepage templates cause blank Editor #64303

Open mikachan opened 1 month ago

mikachan commented 1 month ago

Description

If there are multiple home templates (index, home, front-page) in both PHP and HTML formats, the Editor doesn't seem to understand what to render and will render nothing, with no console errors:

image

I would expect the Editor to either default to the nearest HTML template or show a helpful warning/error message.

Step-by-step reproduction instructions

  1. Add a home.php, front-page.php, index.php and index.html templates to the active theme
  2. Attempt to load the Editor at wp-admin/site-editor.php
  3. See a blank Editor screen

Screenshots, screen recording, code snippet

No response

Environment info

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

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

carolinan commented 1 month ago

Is this related to https://github.com/WordPress/gutenberg/issues/63124 ? But the Site Preview is not black for me but white with the loader showing.

carolinan commented 1 month ago

If there is a PHP equivalent, which is showing on the front, I don't think that the HTML template should be showing in the preview, since the editor and front do not match.

There is also the scenario where there is only a PHP template, and no HTML template to fall back to.

mikachan commented 1 month ago

Is this related to https://github.com/WordPress/gutenberg/issues/63124 ?

Yes I think so! Happy to close this as a duplicate. I was looking for existing issues using "blank editor", "editor broken" 😅 Although I guess we're seeing slightly different things, as you have the white background with the loader, and in my case I saw only the grey background colour. But I'm pretty confident it's the same underlying issue.

If there is a PHP equivalent, which is showing on the front, I don't think that the HTML template should be showing in the preview, since the editor and front do not match.

I agree, that makes sense. We should have a way of communicating this in the Editor, maybe with a <Warning> as you said here.

There is also the scenario where there is only a PHP template, and no HTML template to fall back to.

Yes, these templates don't show in the Editor at all, which suggests that they don't exist. Again it would be ideal to communicate this somehow in the Editor, even if it's a warning message.

hanneslsm commented 1 month ago

A recent issue with a black editor: https://github.com/WordPress/gutenberg/issues/64220 @Mamaduka (since you have tested and self-assigned the other issue already)

mikachan commented 1 month ago

A recent issue with a black editor: https://github.com/WordPress/gutenberg/issues/64220

I believe this issue is caused by a different error, although the result is certainly very similar, with the blank editor.