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

Child theme on Multisite does not work #61608

Open
javiercasares opened this issue May 13, 2024 · 14 comments
Open

Child theme on Multisite does not work #61608

javiercasares opened this issue May 13, 2024 · 14 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended

Comments

@javiercasares
Copy link

Description

When activating a Child Theme in a Multisite it says:

The parent theme is missing. Please install the "abc" parent theme.

Also, the child theme goes to the "Broken" tab.

After doing the "step-by-step"

When you go to the canva part, it broke /wp-admin/site-editor.php?canvas=edit

Related: #58549

Step-by-step reproduction instructions

  1. Install a new WP Multisite with 2 subsites (main + subsite)
  2. Install the Create Block Theme plugin
  3. On the main site, go to the Editor → Create Block Theme → go to the "new" canva editor (using the new options and not the old ones).
  4. Go to the Create new theme from scratch.
  5. Go to the Multisite options and activate the new theme.
  6. Delete all the other themes.
  7. Go, again, to the canva editor, and Create New theme → create a Child theme
  8. Activate the Child Theme as Network (both parent and child may be activated)
  9. Go to the subsite and activate the Child theme

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.5
  • nginx
  • PHP 8.2
  • MariaDB 10.11
  • No plugins

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

@javiercasares javiercasares added the [Type] Bug An existing feature does not function as intended label May 13, 2024
@javiercasares
Copy link
Author

javiercasares commented May 13, 2024

One interesting that also happened is, if I install the TT24 theme, and leave it activated on all the sites / subsites and deactivate the parent theme, then, the Child Theme looks like it works because goes from the Broken Tab to the All tab.

@javiercasares
Copy link
Author

I think I found it… it needs an "index.php". If there is no file there, it doesn't work.

@javiercasares javiercasares changed the title Child theme (with Create Theme Block) on Multisite does not work May 13, 2024
@jordesign jordesign added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Testing Needs further testing to be confirmed. labels May 16, 2024
@nicofyve
Copy link

nicofyve commented May 26, 2024

Adding an empty index.php to TT24 on my multisite installation solved the problem for me, too. Thank you @javiercasares !

EDIT: By chance I found another way to work around this issue:

When I encountered the issue mentioned in the OP, I had the plugin Create Theme Block Network Activated.

The OP issue also disappears for me when the plugin Create Theme Block is NOT Network Activated (without the index.php file added to the TT24 theme). It seems fine to have the plugin activated for the individual site.

@luminuu
Copy link
Member

luminuu commented Jun 6, 2024

Can confirm this is an issue with a missing index.php in a block theme that is used as a parent theme in a multisite environment.

@carolinan
Copy link
Contributor

carolinan commented Jul 4, 2024

I am not able to reproduce this using the following steps:

  • WordPress: 6.7-alpha-58576-src
  • PHP: 7.4.30
  • Server: nginx/1.23.1
  • Database: mysqli (Server: 8.0.36 / Client: mysqlnd 7.4.30)
  • Browser: Chrome 126.0.0.0
  • OS: macOS
  • Theme: (various themes tested)
  • MU Plugins: None activated
  • Plugins:
    • Create Block Theme 2.3.0
    • Health Check & Troubleshooting 1.7.0
    • Test Reports 1.1.0
    • With and without Gutenberg 18.7.0.

Enable multisite that uses the path, not the subdomain.
Network enable the parent theme (twenty twenty-four) and two child themes: one classic, one block.
✅ No issues with either theme on activation.

With the classic theme active, the Site Editor does not load the PHP template from my child theme. The preview looks like it is trying to load something, and there is no message saying that the current template is not editable. Is this what you mean with "When you go to the canva part, it broke /wp-admin/site-editor.php?canvas=edit" @javiercasares?


Using Create Block Theme Version 2.3.0 to create:

  1. a new parent block theme directly on the subsite, or
  2. a new child block theme directly on the subsite,

redirects me to /wp-admin/site-editor.php?canvas=edit which does not load.
It seems more like a plugin problem to me, where it should not be redirecting to canvas=edit ?

@carolinan
Copy link
Contributor

carolinan commented Jul 4, 2024

I am testing the same steps on Windows 11:

  • WordPress: 6.7-alpha-58576-src
  • PHP: 8.2.12
  • Server: nginx/1.25.3
  • Database: mysqli (Server: 8.0.37 / Client: mysqlnd 8.2.12)
  • Browser: Chrome 126.0.0.0
  • OS: Windows 10/11
  • Theme: (various themes tested)
  • MU Plugins: None activated
  • Plugins:
    • Create Block Theme 2.3.0
    • Test Reports 1.1.0
    • With and without Gutenberg 18.7.1.

Manually created child themes:

Both the classic child theme and the block child theme activate without problems or error messages.

Create Block Theme:

  • When I am on the subsite and I use Create Block Theme to create a new parent theme, the parent theme is not immediately activated, nor network enabled.
  • When I am on the subsite and I use Create Block Theme to create a new child theme of Twenty Twenty-Four, the child theme is not immediately activated, nor network enabled.

After creating the theme and pressing OK to reload the browser, it looks like the theme is active, but its not since it is not network enabled. Refreshing the theme screen in the admin shows that the new theme is not active.
Once network enabled, the child theme can be activated without error messages.

@carolinan
Copy link
Contributor

I was able to test sub domains using "Local", WordPress 6.5.5 and 6.6 RC2 on macOS and Windows11, both installations using PHP 8.1.29, and I can not reproduce the issue where the parent theme is missing.

@luminuu
Copy link
Member

luminuu commented Jul 4, 2024

Have you also checked you had the index.php removed from the parent block theme?

@carolinan
Copy link
Contributor

carolinan commented Jul 4, 2024

Yes, neither Twenty Twenty-Four or the parent theme created with create block theme has an index.php.

@carolinan
Copy link
Contributor

My classic child theme that I manually created, did not include theme.json.

@luminuu
Copy link
Member

luminuu commented Jul 4, 2024

I have been trying to reproduce this but can't do it either.

@carolinan
Copy link
Contributor

There are still multiple issues open for this on Trac though.
Perhaps, as suggested in https://core.trac.wordpress.org/ticket/57991, the parent theme was not network enabled?

@luminuu
Copy link
Member

luminuu commented Jul 5, 2024

Nope, disabling the parent theme network wide does not have any effect on the subsite with the active child theme. It still works for me.

Copy link

github-actions bot commented Aug 5, 2024

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 5, 2024
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") Needs Testing Needs further testing to be confirmed. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Bug An existing feature does not function as intended
5 participants