[wp-trac] [WordPress Trac] #49934: PHP Notice: Trying to get property 'name' of non-object in wp-admin/includes/class-wp-site-health.php on line 636

WordPress Trac noreply at wordpress.org
Fri Apr 17 17:45:04 UTC 2020


#49934: PHP Notice:  Trying to get property 'name' of non-object in wp-
admin/includes/class-wp-site-health.php on line 636
---------------------------+---------------------------------------
 Reporter:  juanlopez4691  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Site Health    |    Version:  5.4
 Severity:  normal         |   Keywords:  needs-patch needs-testing
  Focuses:                 |
---------------------------+---------------------------------------
 Changes in method `get_test_theme_version` from class `WP_Site_Health`
 introduced an issue that causes a PHP Notice to be thrown in admin page
 `Tools > Site Health`:

 {{{
 PHP Notice:  Trying to get property 'name' of non-object in wp-
 admin/includes/class-wp-site-health.php on line 636
 }}}

 This could be solved changing line 617 from
 {{{#!php
 $active_theme->parent()->name
 }}}
 To
 {{{#!php
 $active_theme->parent() ? $active_theme->parent()->name : ''
 }}}

 Or to
 {{{#!php
 $active_theme->parent_theme
 }}}

 Same problem happens in line 636, same solution applies.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49934>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list