Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank page when templates/index.html exists in classic themes. #38315

Open
costdev opened this issue Jan 28, 2022 · 2 comments
Open

Blank page when templates/index.html exists in classic themes. #38315

costdev opened this issue Jan 28, 2022 · 2 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Needs Technical Feedback Needs testing from a developer perspective. [Status] Blocked Used to indicate that a current effort isn't able to move forward [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@costdev
Copy link
Contributor

costdev commented Jan 28, 2022

Description

See the related Trac ticket: https://core.trac.wordpress.org/ticket/54910

If a classic theme has templates/index.html, which may be empty or have non-block HTML markup in it, it can be incorrectly identified as a block theme. For example, some developers and/or hosts, whether good practice or not, can place an index.html file in every directory to prevent directory listing. Alternatively, some classic themes may have other uses for templates/index.html, and the classic theme may not be actively, or regularly, maintained. This has resulted in some users receiving a white screen upon updating to 5.9.

An idea from @carolinan in the Trac ticket above suggested checking templates/index.html for block markup. The patch aims to do exactly that. However, this needs insights and evaluation from the editor team regarding block theme architecture and we also need to consider performance. We've implemented caching using WP_Theme::cache_get()/add()/delete() to help with this.

Step-by-step reproduction instructions

  1. Create a classic theme which happens to include an empty templates/index.html.
  2. Activate the theme.
  • The Editor item will be available and the frontend will (likely) output Empty template: Index.
  1. Add some non-block HTML to templates/index.html.
  • The Editor item will be available.
  • Viewing the Editor will (likely) show This block has encountered an error and cannot be previewed..
  • The frontend will output the non-block HTML inside .wp-site-blocks.

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@costdev costdev changed the title Blank home page when templates/index.html exists in classic themes. Blank page when templates/index.html exists in classic themes. Jan 28, 2022
@karmatosed karmatosed added the Needs Testing Needs further testing to be confirmed. label Jan 28, 2022
@Trapsta
Copy link
Contributor

Trapsta commented Feb 17, 2022

@costdev guessing this should be currently status blocked pending discussion on the trac ticket on how best to implement the patch but I think in the meantime we could be testing for any issues that might come up in the editor and also check for any performance hits/concern from the patch. correct?

@costdev
Copy link
Contributor Author

costdev commented Feb 18, 2022

@Trapsta At the moment it looks that way yes. Testing is much appreciated! 🙂

@skorasaurus skorasaurus added [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Status] Blocked Used to indicate that a current effort isn't able to move forward Needs Technical Feedback Needs testing from a developer perspective. and removed Needs Testing Needs further testing to be confirmed. labels Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Needs Technical Feedback Needs testing from a developer perspective. [Status] Blocked Used to indicate that a current effort isn't able to move forward [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

No branches or pull requests

4 participants