[wp-trac] [WordPress Trac] #54905: PHP notice while accessing Customizer

WordPress Trac noreply at wordpress.org
Tue May 3 20:40:07 UTC 2022


#54905: PHP notice while accessing Customizer
-------------------------------------------------+-------------------------
 Reporter:  Boniu91                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.9.4
Component:  Customize                            |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-testing-info has-screenshots     |     Focuses:
  has-patch                                      |
-------------------------------------------------+-------------------------
Changes (by ironprogrammer):

 * keywords:  needs-testing has-testing-info has-screenshots has-patch =>
     has-testing-info has-screenshots has-patch


Comment:

 Thank you, @azouamauriac, for the updated patch!

 == Test Report

 [https://core.trac.wordpress.org/attachment/ticket/54905/54905.diff Patch
 54905] 👍🏻

 === Env
 * WordPress 6.1-alpha-53344-src
 * Chrome 100.0.4896.127
 * macOS 12.3.1 (Monterey)
 * Theme: Twenty Twenty-Two
 * Gutenberg DISABLED 🔴
 * Plugin: WooCommerce (activated, but not configured)
 * In wp-config.php: `define( 'WP_DEBUG_LOG', true );`

 === Steps to Test (BEFORE PATCH)
 1. Navigate to ''Appearance > Customize'' (menu enabled by WooCommerce).
 1. Observe that upon page load, the following PHP notices are logged to
 `/wp-content/debug.log` (paths modified for privacy):

 {{{
 [03-May-2022 20:26:43 UTC] PHP Notice:  Trying to get property 'title' of
 non-object in [...]/wp-includes/class-wp-customize-nav-menus.php on line
 523
 [03-May-2022 20:26:43 UTC] PHP Notice:  Trying to get property 'title' of
 non-object in [...]/wp-includes/class-wp-customize-widgets.php on line 899
 [03-May-2022 20:26:43 UTC] PHP Notice:  Trying to get property 'title' of
 non-object in [...]/wp-includes/class-wp-customize-nav-menus.php on line
 1152
 }}}

 === Steps to Test (AFTER PATCH)
 1. Navigate to ''Appearance > Customize'' (menu enabled by WooCommerce).
 1. Observe that on page load, the identified PHP notices are NOT logged to
 `/wp-content/debug.log`.

 === Expected Results (✅)
 - The patch mitigates logging of the identified PHP notices.

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


More information about the wp-trac mailing list