[wp-trac] [WordPress Trac] #58183: PHP notice when accessing Customizer with a classic theme without widgets

WordPress Trac noreply at wordpress.org
Mon Apr 24 16:13:28 UTC 2023


#58183: PHP notice when accessing Customizer with a classic theme without widgets
--------------------------+------------------------------
 Reporter:  kraftner      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> If you open the Customizer with a classic theme that doesn't have any
> widget areas registered the following PHP warning is emitted:
>

> {{{
> PHP Warning:  Attempt to read property "title" on null in /var/www/html
> /wp-includes/class-wp-customize-widgets.php on line 905
> PHP Stack trace:
> PHP   1. {main}() /var/www/html/wp-admin/customize.php:0
> PHP   2. do_action($hook_name =
> 'customize_controls_print_footer_scripts') /var/www/html/wp-
> admin/customize.php:302
> PHP   3. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-
> includes/plugin.php:517
> PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => ''])
> /var/www/html/wp-includes/class-wp-hook.php:332
> PHP   5. WP_Customize_Widgets->output_widget_control_templates('')
> /var/www/html/wp-includes/class-wp-hook.php:308
> }}}
>

> This seems to be similar to #54905.
>
> It seems that this is a similar issue, also mentioned by #56142, but not
> included in the fix deployed with #54419 since @westonruter wasn't able
> to reproduce it: https://core.trac.wordpress.org/ticket/54905#comment:38
>
> This tickets adds the steps to reproduce it in the hope to then be able
> to find a fix.
>
> == Steps to reproduce
>
> 1. Create/Use a classic theme that does **not** have Widgets.
> 2. Open the customizer
> 3. Find the PHP warning in the logs.
>
> == Versions
>
> WordPress 6.2
> PHP 8.2
>
> (But also appears with other, older combinations, e.g. WP 5.9 and PHP
> 8.0)

New description:

 If you open the Customizer with a classic theme that doesn't have any
 widget areas registered the following PHP warning is emitted:


 {{{
 PHP Warning:  Attempt to read property "title" on null in /var/www/html
 /wp-includes/class-wp-customize-widgets.php on line 905
 PHP Stack trace:
 PHP   1. {main}() /var/www/html/wp-admin/customize.php:0
 PHP   2. do_action($hook_name = 'customize_controls_print_footer_scripts')
 /var/www/html/wp-admin/customize.php:302
 PHP   3. WP_Hook->do_action($args = [0 => '']) /var/www/html/wp-
 includes/plugin.php:517
 PHP   4. WP_Hook->apply_filters($value = '', $args = [0 => ''])
 /var/www/html/wp-includes/class-wp-hook.php:332
 PHP   5. WP_Customize_Widgets->output_widget_control_templates('')
 /var/www/html/wp-includes/class-wp-hook.php:308
 }}}


 This seems to be similar to #54905.

 It seems that this is a similar issue, also mentioned by #56142, but not
 included in the fix deployed with [54419] since @westonruter wasn't able
 to reproduce it: https://core.trac.wordpress.org/ticket/54905#comment:38

 This tickets adds the steps to reproduce it in the hope to then be able to
 find a fix.

 == Steps to reproduce

 1. Create/Use a classic theme that does **not** have Widgets.
 2. Open the customizer
 3. Find the PHP warning in the logs.

 == Versions

 WordPress 6.2
 PHP 8.2

 (But also appears with other, older combinations, e.g. WP 5.9 and PHP 8.0)

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58183#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list