Opened 5 weeks ago
Last modified 5 weeks ago
#63151 reviewing defect (bug)
[E_WARNING] class-wp-customize-widgets.php:923
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | has-patch has-unit-tests needs-testing has-testing-info |
Focuses: | Cc: |
Description
Error occured at Customize page.
[E_WARNING]: Attempt to read property "title" on null in /wp-includes/class-wp-customize-widgets.php on line 923
URL Path: /wp-admin/customize.php
Theme: custom theme without widgets
Change History (12)
#2
in reply to:
↑ 1
;
follow-up:
↓ 3
@
5 weeks ago
Environment
- WordPress 6.7.2
- PHP: 8.1.2
- Server: Apache/2.4.52 (Ubuntu)
- Database: mysql Ver 8.0.41-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))
- Browser: Chrome 134.0.6998.118
- Theme: minimal custom theme with empty functions.php
- MU Plugins: None activated
- Plugins: None activated
Reproduction Steps
Make and activate minimal custom theme with empty functions.php
Go to customizer
Check server apache2/error.logs
[Sun Mar 23 13:50:07.786408 2025] [php:warn] [pid 1197845] [client X.X.X.X:XXXXX] PHP Warning: Attempt to read property "title" on null in /var/www/mydomain.com/wp-includes/class-wp-customize-widgets.php on line 923, referer: https://mydomnain.com/
Additional Notes
The problem is #available-widgets
template trying to access panel title on null, because panel with id widgets
is not loaded by WP_Customize_Manager
.
This is WP issue, because theme developers are not required to support widgets in their custom themes.
#3
in reply to:
↑ 2
@
5 weeks ago
Make and activate minimal custom theme with empty functions.php
Go to customizer
Check server apache2/error.logs
How do you expect anyone can reproduce this without the custom minimal theme code?
#4
follow-up:
↓ 5
@
5 weeks ago
https://developer.wordpress.org/themes/classic-themes/your-first-theme/#classic-theme
Step 1 – Create a theme folder
Step 2 – Create a style.css file
https://gist.github.com/philiparthurmoore/0496a9b659c12280666d
Step 3 – Create an index.php file
https://gist.github.com/philiparthurmoore/b1f47c15d3eb2c573924
Step 4 – Install Your Theme
Step 5 – Activate Your Theme
#5
in reply to:
↑ 4
@
5 weeks ago
- Keywords reporter-feedback removed
- Resolution set to invalid
- Status changed from new to closed
Replying to ArtZ91:
https://developer.wordpress.org/themes/classic-themes/your-first-theme/#classic-theme
Step 1 – Create a theme folder
Step 2 – Create a style.css file
https://gist.github.com/philiparthurmoore/0496a9b659c12280666d
Step 3 – Create an index.php file
https://gist.github.com/philiparthurmoore/b1f47c15d3eb2c573924
Step 4 – Install Your Theme
Step 5 – Activate Your Theme
@ArtZ91
I suggest you move into the next chapter on building your first theme:
https://developer.wordpress.org/themes/basics/
That is not enough to fully build a classic theme, you are barely scraping the surface.
For example, there is a whole topic on theme functions:
https://developer.wordpress.org/themes/basics/theme-functions/
As I said, this is not a forum to learn about WordPress development, this is only for WordPress issues reports.
Please refer to this forum if you have further questions on how to build your first theme if you can't find the info in the URLs I provided you.
#6
@
5 weeks ago
- Resolution invalid deleted
- Status changed from closed to reopened
It's bug in your core, just make proper checks in your template!
I'm not need your help in "basics".
Just say for me, where is described, that custom theme must support this widgets feature? It's optional.
You ask me for minimal theme, I provide it. I can't get you full production website theme, because it's not required to this issue.
This ticket was mentioned in Slack in #core by artz91. View the logs.
5 weeks ago
#8
@
5 weeks ago
- Keywords needs-patch added
- Version 6.7.2 deleted
Indeed, this may be something we can fix in Core.
This ticket was mentioned in PR #8568 on WordPress/wordpress-develop by @SirLouen.
5 weeks ago
#9
- Keywords has-patch has-unit-tests added; needs-patch removed
After some discussion in Slack I'm going to bring some context to this topic:
I never realized that a theme could have no sidebars but @audrasjb brough this:
This may be something we can improve on Core, or at least something that should be documented.
And the use-case of ArtZ91:
how I see it from my side: my goal as a developer is to create some templates based on a specific design. There are no sidebars, so I don't think I need to implement the widgets feature if it's not going to be used. Any another developer, I think, do the same for local business, and they sometimes not used widgets.
So basically, here I provide a patch to avoid the requirement of a widget sidebar area.
Testing Instructions:
- Create a basic classic theme with only
style.css
andindex.php
, can follow these two files provided in docs instructions: https://developer.wordpress.org/themes/classic-themes/your-first-theme/#classic-theme - Activate such theme
- Go to the theme Customizer
- Check server
debug.log
- Before patch, a warning should appear. After patch warning should be sorted.
Trac ticket: https://core.trac.wordpress.org/ticket/63151
Reproduction Report
Description
This report can't validate that the issue can be reproduced.
Environment
Reproduction Steps
Actual Results
Additional Notes
@ArtZ91 can you provide further reproduction instructions?
Which theme are you using?
We need your full setup to understand the problem, also consider that there could be an issue in your custom theme's code (or any widget you are using). This is not a support forum, in that case, here you will find better answers