-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Empty Website-Editor (JavaScript error) without explicit template selection #35560
Comments
The site switched from a non-FSE/blocks theme to a FSE/blocks-supporting one, also with different templates. Also the JavaScript error should be fixed, as the code currently expects a valid set template parameter and cannot find it. |
Hi You mention front page- do you mean that the first theme is non-FSE theme with a I would expect it to fallback to index.html. 🤔 |
I too had this issue with WordPress It appears if I add On further investigation, it appears to not be selecting the index.html template at all. If I change the "front page" to an actual page, it selects page.html but setting the front page to empty I once again have the same error as above. Hope this bit of info might help. |
And when you say "change the front page" you mean the Settings > Reading... Your homepage displays.... A static page? |
@carolinan yes, exactly that. |
Same for me. According to https://developer.wordpress.org/block-editor/how-to-guides/themes/create-block-theme/. "There are two files that are required to activate any theme: index.php and style.css. Adding this doesn't seem to work on existing themes. I haven't tried this on just a bare bones theme with only the above as a start but adding the above to an existing theme results in the error causing the editor not to load. For I added a page.html but that didn't work either. I then added a front-page.html and that resolved the issue. As @strarsis menitioned earlier the JS error should be fixed so that it doesn't just fail. If template doesn't exist the template editor should fall back to a template that does exist or show a message if no templates exist. |
I have created a one page theme that only has the index.html template, but I am not able to reproduce this. It displays the same template no matter what the reading setting is on. Are you able to share the test theme and any more details about your environment including WordPress version and confirm if there are any other plugins installed? |
@carolinan After further testing here is the exact issue. If you have a If I remove my |
If you delete the template after you add it then you see an message that says "You attempted to edit an item that doesn't exist. Perhaps it was deleted?" the difference being that it has query parameters. Where as just going to the site editor from the admin menu does not. |
Block themes are meant to prioritize HTML templates and then use the PHP template if it can't find the HTML template, but the PHP template can never be edited in the site editor. |
Of course the site editor would not edit the PHP template. That is not what I am saying. I was very clear. Add a |
@jakerambo that's exactly it. My experiments with enabling FSE on existing themes were failing with the
The error does occur regardless of the Homepage setting in Settings -> Reading: If the php file exists, the Block Theme stuff appears to look for a front-page.html file and throws if that file is not found. With the Homepage setting reverted to "Your latest posts", the Editor still throws an error. The same thing seems to happen with page.php, if that php template file exists I get the |
Is there any more information that you can provide about the environment, or a copy of the test themes? I have added Fresh install, WordPress 5.9.0. with and without Gutenberg trunk. PC, Windows 10, Chrome. Local. Click to view Site health info` ### wp-core ###version: 5.9 wp-active-themename: Twenty Twenty (twentytwenty) wp-mediaimage_editor: WP_Image_Editor_Imagick wp-serverserver_architecture: Windows NT 10.0 AMD64 wp-databaseextension: mysqli wp-constantsWP_HOME: undefined wp-filesystemwordpress: writable |
@carolinan From a fresh 5.9 install with no plugins. Twenty Nineteen - add Twenty Twenty - add Twenty Twenty One - add Twenty Seventeen - interestingly, I cannot reproduce issue. Hope this helps. |
@carolinan Here are my steps to recreate the issue from a clean install: Environment is the official For a clean start, be sure to remove the docker volumes between runs, or just delete them from the docker-compose file. Steps to reproduce
The Editor will work correctly after creating front-page.html: Alternately, with page.php:
The Editor will work correctly after creating page.html: JS error text is the same for both:
|
Hi everyone The issue was resolved via #38817. The new template resolution method ignores the PHP templates. See this comment for more details - #38817 (comment) |
Description
When opening the Website-Editor (Full Site Editing (FSE)-supporting theme),
the editor area is greyed out and no blocks can be placed there, when no page template is explicitly selected.
After explicitly selecting a template from the sidebar (Selecting the logo at the top right opens the sidebar) fixes the issue.
But this shouldn't happen at all - also the page is a front page, so some default template settings should apply.
JavaScript console shows an error:
Step-by-step reproduction instructions
5.8.1
) and Gutenberg plugin (11.6.0
) are installed and enabled.Screenshots, screen recording, code snippet
Code that caused the exception:
Environment info
5.8.1
11.6.0
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
The text was updated successfully, but these errors were encountered: