Skip to content

Parent theme wrongly missing (6.5-alpha-57505) #58549

@DennysDionigi

Description

@DennysDionigi

Description

Following WordPress/twentytwentyfour#733

The thread has been closed, but the issue is still there and still need a fix.

There is a bug in latest WordPress FSE Core Updates and/or any FSE theme.

The following is the error: The parent theme is missing. Please install the "XXX" parent theme. when trying to set up the most basic of Child Themes.

I also believe this could be related to Multisite, or to the way the core searches for any php file related to parent theme (which blocks based themes have not, or at least... not mandatory).

The double problem is that: even both sibling theme exist, parent and child, and even if folder names and directories are the required and right ones, this alert should not appear.

This error, obviously brings to delete the child theme, and lead to, maybe, future bigger issues, missing fields, blocks, metabox and so on.

Step-by-step reproduction instructions

Steps to Reproduce

Create a child theme

Create a new directory: wp-content/themes/twentytwentyfour-child
Create a child theme style.css file, containing Theme Name: Twenty Twenty-Four Child and Template: twentytwentyfour (Screenshot)
Visit WordPress Admin > Appearance > Themes (Screenshot)
Activate the Twenty Twenty-Four Child (Screenshot)
(Screenshot of Directory Structure)

Expected Behavior

Visiting the site with the active child theme displays the default Twenty Twenty-Four home page with all styles loaded correctly.

Actual Behavior

At first, there is a success message "New theme activated. Visit site"
Reloading the page results in the following error message: "Error: The parent theme is missing. Please install the "twentytwentyfour" parent theme." (Screenshot)
Visiting the site results in a blank white screen where the .wp-site-blocks element is empty. (Screenshot)

Potential patch

I added an empty index.php inside parent child theme


Other Notes

This is a fresh, standard WordPress installation (v6.5-alpha-57505)
There are no active plugins on the site.
There are no special directory changes or customizations.

As mentioned before, this is a Multisite install, even if there's no actual secondary website.
I tested on a non-Multisite instance, and randomly I still have the issue.

I would assume patching WordPress would be more difficult than just dropping a blank index.php file into the theme (and it doesn't appear to have any affect on anything), so maybe as a temporary solution, index.php could be added to block themes?

Or skip the requirement on an index.php at all.

Screenshots, screen recording, code snippet

No response

Environment info

Wordpress 6.5-alpha-57505

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugAn existing feature does not function as intended[Type] WP Core TicketRequires an upstream change from WordPress. Core Trac ticket should be linked.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions