[wp-trac] [WordPress Trac] #57851: PHP notice error when template part is created

WordPress Trac noreply at wordpress.org
Thu Mar 2 15:45:10 UTC 2023


#57851: PHP notice error when template part is created
--------------------------+-----------------------------
 Reporter:  wildworks     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Originally reported in the Gutenberg repository:
 https://github.com/WordPress/gutenberg/issues/48596

 I get a PHP notice error when adding a new template part in the site
 editor.


 {{{
 PHP Notice:  Trying to get property 'area' of non-object in /var/www/src
 /wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on
 line 581
 }}}

 When adding a new template part, the $template variable will be null, so
 this error would occur.

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


More information about the wp-trac mailing list