#63062 closed defect (bug) (fixed)
Parent theme incorrectly not getting resolved in WordPress 6.8-beta1
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | high |
Severity: | normal | Version: | trunk |
Component: | Themes | Keywords: | has-patch needs-unit-tests needs-testing has-testing-info has-screenshots |
Focuses: | Cc: |
Description
I just installed 6.8-beta1 on a site that is using a child theme and noticed that it's parent theme is no longer getting resolved. The themes both still appears in the themes listing but the child theme shows that it is broken because the parent theme is missing.
Downgrading to 6.7.2 resolves the issue again.
I was able to reproduce it with the most bare child theme possible off of a core theme.
Attachments (17)
Change History (54)
This ticket was mentioned in PR #8466 on WordPress/wordpress-develop by @joemcgill.
3 weeks ago
#2
- Keywords has-patch has-unit-tests added
This reverts https://core.trac.wordpress.org/changeset/59885 (83b9080).
Trac ticket: https://core.trac.wordpress.org/ticket/63062
#3
@
3 weeks ago
- Keywords has-patch has-unit-tests removed
- Priority changed from normal to high
- Status changed from reviewing to accepted
- Version set to trunk
Using git-bisect
, it looks like this regression was introduced in [59885]. I'm guessing that calling wp_is_block_theme()
this early is likely polluting the cache prior to themes being set up.
I've created a PR that reverts that commit for testing, but we should find a way to fix this without fully reverting the commit that fixed #61811.
#5
@
3 weeks ago
Updated the PR with a small fix. Hoping to get some tests added and consider whether we want to address the root cause rather than just this bug. I've left more details in the PR.
This ticket was mentioned in Slack in #core by jeffr0. View the logs.
3 weeks ago
#7
@
3 weeks ago
Thank you for reporting this issue @fabiankaegy I too encountered this today after installing 6.8 Beta 1 while using a Child theme.
#8
@
3 weeks ago
- Keywords has-testing-info has-screenshots added
Test Report
Description
I verified the PR with Playground and shared child theme zip and looks like it is working as expected now.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8466
Environment
- WordPress: 6.8-beta1-20250305.214555
- PHP: 7.4.31-dev
- Server: PHP.wasm
- Database: WP_SQLite_Translator (Server: 5.5 / Client: 3.40.1)
- Browser: Chrome 133.0.0.0
- OS: macOS
- Theme: Minimal Child Theme 1.0.2
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
- ✅ Issue resolved with patch.
Supplemental Artifacts
Add as Attachment
This ticket was mentioned in Slack in #core-test by krupajnanda. View the logs.
3 weeks ago
#10
@
3 weeks ago
Ticket Reference: Issue with Parent Theme Resolution in WordPress 6.8-beta1
Before the patch screenshot
https://tinyurl.com/2c5dduqp
After Patch screenshot
https://tinyurl.com/24wu4q2q
Issue Summary: installing WordPress 6.8-beta1 on a site using a child theme, it was observed that the parent theme was no longer being resolved. The child theme appeared broken in the themes listing, displaying the error:
Error: The parent theme is missing. Please install the "twentytwentyfive" parent theme.
However, downgrading to WordPress 6.7.2 resolved the issue, restoring the child theme’s functionality.
Steps to Reproduce (Before Patch):
Install WordPress 6.8-beta1.
Set up a child theme that depends on a core theme (e.g., twentytwentyfive).
Navigate to the WordPress admin panel under Appearance > Themes.
Observe that the child theme is marked as broken with the above-mentioned error.
Expected Behavior (Before Patch):
The child theme should correctly recognize its parent theme and function normally.
Actual Behavior (Before Patch):
The parent theme was not being detected.
The child theme was marked as broken and unusable.
Testing After Applying the Patch:
Updated WordPress to the patched version.
Retested with the same child theme setup.
Observed that the child theme now correctly recognizes its parent theme.
Verified that the error message no longer appears and the child theme is fully functional.
Results (After Patch):
The issue is successfully resolved.
The child theme correctly inherits from the parent theme as expected.
No error messages were displayed.
Conclusion:
The applied patch effectively fixes the parent theme resolution issue introduced in WordPress 6.8-beta1. After testing, the child theme is now working properly without any errors.
#11
@
3 weeks ago
Parent theme incorrectly not getting resolved in WordPress 6.8-beta1
Description
I just installed 6.8-beta1 on a site that is using a child theme and noticed that it's parent theme is no longer getting resolved. The themes both still appears in the themes listing but the child theme shows that it is broken because the parent theme is missing.
Downgrading to 6.7.2 resolves the issue again.
According to @fabiankaegy, able to reproduce it with the most bare child theme possible off of a core theme.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8466
Environment
- WordPress: 6.8-beta1-59940
- PHP: 8.4.1
- Server: Apache/2.4.62 (Unix) mod_wsgi/5.0.1 Python/3.12 mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.1.1w
- Database: WP_SQLite_DB\PDOEngine (Server: 3.47.0 / Client: 3.47.0)
- Browser: Chrome 133.0.0.0
- OS: macOS
- Theme: Minimal Child Theme 1.0.2
- MU Plugins: None activated
- Plugins:
- Child Theme Configurator 2.6.6
- Test Reports 1.2.0
- WP File Manager 8.0.1
Actual Results
- ✅ Issue resolved with patch.
Supplemental Artifacts
#12
@
3 weeks ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8466
Environment
- OS: macOS 14.6.1
- Web Server: PHP.wasm
- PHP: 7.4.31-dev
- WordPress: 6.8-beta1-20250305.214555
- Browser: Chrome Version 133.0.6943.142
- Theme: Minimal Child Theme Version 1.0.2
Actual Results
- ✅ Issue resolved with patch.
Reference Screens Attached.
#13
@
3 weeks ago
Test Report
Description
This report validates whether the indicated patch for the child theme.
Patch tested: https://patch-diff.githubusercontent.com/raw/WordPress/wordpress-develop/pull/8466.diff
Environment
- WordPress: 6.8-beta1-59933-src
- PHP: 8.2.27
- Server: nginx/1.27.4
- Database: mysqli (Server: 8.4.4 / Client: mysqlnd 8.2.27)
- Browser: Chrome 133.0.0.0
- OS: macOS
- Theme: Minimal Child Theme 1.0.2
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Actual Results
- ✅ Issue resolved with patch.
#14
@
3 weeks ago
Tested Additional Use Cases Apart from the Above-Listed Test Reports
- Since the issue was related to a Block-based theme, verified the fixes with a Non-Block-based theme like Storefront to check regression. Everything worked as expected ✅
- Verified behavior when the parent theme is not installed (or deleted) while the child theme is still present. A message correctly appeared: _"The active theme is broken. Reverting to the default theme."_ ✅
- Before the fix: The WP-CLI command (
wp theme list
) did not show the child theme in the theme list. After the fix: Verified that the child theme is now correctly listed. (Screenshots attached) ✅ - Tested via created Block-based (Twenty Twenty-Five) Child theme and Non-Block-based (Storefront) child themes to ensure compatibility. ✅
- Backward Compatibility: Reverted back to WordPress 6.7.2 after using the fix-specific branch. No issues appeared. ✅
- Attached child theme zip for TT5 and Storefront for further testing. ℹ
- No related console error or PHP errors observed while testing above use cases. ✅
- Full Site Editing works when Child theme is installed and active ✅
Before Fix: https://prnt.sc/W8P0mfiMiGZ9
After Fix: https://prnt.sc/2VlTiXuessjY
#15
@
3 weeks ago
Test Report
This report validates that the indicated patch addresses the issue.
Patch tested:
https://github.com/WordPress/wordpress-develop/pull/8466
Environment
OS: macOS 14.6.1
Web Server: PHP.wasm
PHP: 7.4.31-dev
WordPress: 6.8-beta1-20250305.214555
Browser: Chrome Version 133.0.6943.142
Theme: Minimal Child Theme Version 1.0.2
Actual Results
✅ Issue resolved with patch.
@audrasjb commented on PR #8466:
3 weeks ago
#16
I tested this PR and it seems to fix the issue.
Before applying the PR:
before-applying-the-PR.webm
After applying the PR:
after-applying-the-PR.webm
@audrasjb commented on PR #8466:
3 weeks ago
#17
I tested this PR and it seems to fix the issue.
Before applying the PR:
before-applying-the-PR.webm
After applying the PR:
after-applying-the-PR.webm
#19
@
3 weeks ago
Hi,
Test Report:
Verified the fix on the attached theme with the patch, and it is working fine. Able to activate the theme successfully.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8466
Environment
WordPress: 6.8-beta1-2025030
OS: macOS
Theme: Minimal Child Theme
Actual Result: The fix is working properly, and the theme can be activated.
Screenshots:
Before fix: https://prnt.sc/__bk9MWO1xx2
After fix: https://prnt.sc/VR7Uj-ODliIo
Thanks
#20
@
3 weeks ago
Test Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/8466
Environment:
WordPress - 6.8-beta1
OS - Windows
Browser - Firefox
Theme: Minimal Child Theme
PHP - 8.2.12
Active Plugin: None
Actual Results:
- Issue Resolved With Patch.✅
Screenshots:
- Added Attachment
@joemcgill commented on PR #8466:
2 weeks ago
#21
I've updated the logic here to move setting post type support to a standalone callback, as suggested in this comment. @peterwilsoncc any chance you can take another look at this before beta 2?
@joemcgill commented on PR #8466:
2 weeks ago
#23
This ticket was mentioned in Slack in #core by krupajnanda. View the logs.
2 weeks ago
#25
@
2 weeks ago
Due to the influence of the _doing_it_wrong
, it seems that the customizer displays a warning. See https://core.trac.wordpress.org/ticket/63086
#26
@
2 weeks ago
In addition, if
WP_Theme::is_block_theme
is called too early, a_doing_it_wrong()
error will now be thrown.
This early return might cause problems if you have a theme or plugin that is calling WP_Theme::is_block_theme
too early.
For example, if the following plugin is enabled:
<?php /** * Plugin Name: Block Theme Test */ wp_is_block_theme();
At this time, the site editor appears to display a black screen.
#27
@
2 weeks ago
Another example: In some cases, the submenu in the Appearance menu may change from Editor to Design, making the site editor itself inaccessible.
This ticket was mentioned in Slack in #core by mamaduka. View the logs.
2 weeks ago
#29
@
2 weeks ago
Thanks, @wildworks, for the initial exploration. As mentioned in [63086], this change causes regressions in plugins relying on wp_is_block_theme()
, such as WooCommerce.
Based on the discussion, this change seems necessary because wp_is_block_theme()
may return an incorrect value due to inaccurate parent theme resolution before after_setup_theme
. A potential solution could be addressing the parent theme resolution issue.
After some investigation (cc @nerrad), we found:
wp_is_block_theme()
callswp_get_theme()
to retrieve the theme and invokes theis_block_theme()
method.wp_get_theme()
instantiatesWP_Theme
, which sets a cache on the first run. If executed beforeafter_setup_theme
, the theme's functions.php will not have been processed, resulting in an incorrect cache.
A possible solution could be to only set the cache on WP_Theme
if instantiated after after_setup_theme
; otherwise, avoid caching.
It is essential to take careful consideration of performance implications.
#30
@
12 days ago
Digging deeper into the Core to understand the issue, I found that:
wp_is_block_theme
doesn't need to be called afterafter_theme_setup
, it just needs to be called after theme directories registration.- The initial issue with the child theme is caused by calling that function after creating post types, which is before the theme directories registration.
- Moving that logic to
after_theme_setup
, as we did in this ticket, is enough to solve the issue. - Plugins can never break the theme resolution because they are loaded after theme directories registration.
So the warning and early return don't protect us from anything and should be removed.
This ticket was mentioned in Slack in #core-committers by nerrad. View the logs.
12 days ago
This ticket was mentioned in PR #8508 on WordPress/wordpress-develop by @dinhtungdu.
12 days ago
#32
This PR partially reverts https://core.trac.wordpress.org/changeset/59968 by removing the warning and early return in WP_Theme::is_block_theme()
, which causes issues if active plugins call wp_is_block_theme()
early. It's safe for plugins to call wp_is_block_theme()
anytime so the early return and warning should be removed.
Trac ticket: https://core.trac.wordpress.org/ticket/63062
#33
@
10 days ago
FWIW is_block_theme()
is called in the constructor for WP_Theme and this error and early return is causing loads of issues in plugins because of that.
10 days ago
#34
Absolutely agree. This is filling up my logs and not sure it's even effecting function.
#35
@
9 days ago
Hi all, I appreciate everyone's testing and feedback so far! #63086 is tracking the _doing_it_wrong()
placement. Let's consolidate further conversation over there to try to keep things in one place.
@dinhtungdu commented on PR #8508:
8 days ago
#36
Closing in favor of #8526
Most basic version of a child theme with which I am able to reproduce the issue