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

Wrong template displayed for hybrid themes in the post template editor #64341

Open jffng opened 1 month ago

jffng commented 1 month ago

Description

The post template editor shows the wrong template for hybrid themes that contain a mix of block and php templates.

Step-by-step reproduction instructions

  1. Activate a classic theme that has a single.php or page.php (e.g. twentytwentyone)
  2. Add a templates/index.html file.
  3. Go to add / edit a post or page.
  4. Verify the template editor renders the index.html, instead of single.php.
  5. Verify the front-end renders the single.php.

Screenshots, screen recording, code snippet

https://github.com/user-attachments/assets/7234ddf6-892a-4428-98bb-015d4c5eaff1

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.

carlomanf commented 1 month ago

I think these may be related and/or duplicate issues: #31633 #63124 #64303