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

Non-error, unexpected response for _wp-find-template not handled #45170

Open
strarsis opened this issue Oct 20, 2022 · 1 comment
Open

Non-error, unexpected response for _wp-find-template not handled #45170

strarsis opened this issue Oct 20, 2022 · 1 comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.

Comments

@strarsis
Copy link
Contributor

Description

When a non-error, unexpected response (not HTTP 404, but 200) is sent for a _wp-find-template request, e.g. a HTML page,
no error or warning message is emitted, instead the Gutenberg site editor simply stays blank, without any indication for why it fails.

Related issue: #37236
The added error handling doesn't validate the response schema/data. A HTTP 400 response with HTML will not cause an error, instead the editor simply stays blank.

That a HTML response is sent back for _wp-find-template can be caused by loaders in themes that add support for additional languages, e.g. Blade-PHP for hybrid FSE themes.

Step-by-step reproduction instructions

  1. Create a theme that supports Full Site Editing (FSE).
  2. Simulate a bug where a non-error, unexpected error response is send for _wp-find-template requests from the Gutenberg site editor.
  3. Open the Gutenberg site editor, note that it does a _wp-find-template request, receives the unexpected, non-error response and stays blank.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress version 6.0.3, Gutenberg version 14.3.1 .

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

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Package] Edit Site /packages/edit-site [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Package] Edit Site /packages/edit-site labels Oct 20, 2022
@strarsis
Copy link
Contributor Author

strarsis commented Oct 21, 2022

The same issue also occurs when remove_theme_support('block-templates'); is used but a theme.json and block-templates/-parts are included, with which the (FSE) site editor is offered. The Design → Editor feature is still available, but the editor then fails to initialize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants