id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses 57851 PHP notice error when template part is created wildworks audrasjb "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. == Original Report: Reporter: @chrystl === Description I get the notice below with WordPress 6.2-beta3-55428 and and Twenty Twenty Three (only) when creating a new TP from the TP block inside a TP. {{{ [PHP Notice: Trying to get property 'area' of non-object in /wp-single/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 586 [PHP Stack trace: [PHP 1. {main}() /wp-single/index.php:0 [PHP 2. require() /wp-single/index.php:17 [PHP 3. wp() /wp-single/wp-blog-header.php:16 [PHP 4. WP->main() /wp-single/wp-includes/functions.php:1330 [PHP 5. WP->parse_request() /wp-single/wp-includes/class-wp.php:780 [PHP 6. do_action_ref_array() /wp-single/wp-includes/class-wp.php:399 [PHP 7. WP_Hook->do_action() /wp-single/wp-includes/plugin.php:565 [PHP 8. WP_Hook->apply_filters() /wp-single/wp-includes/class-wp-hook.php:332 [PHP 9. rest_api_loaded() /wp-single/wp-includes/class-wp-hook.php:308 [PHP 10. WP_REST_Server->serve_request() /wp-single/wp-includes/rest-api.php:410 [PHP 11. WP_REST_Server->dispatch() /wp-single/wp-includes/rest-api/class-wp-rest-server.php:442 [PHP 12. WP_REST_Server->respond_to_request() /wp-single/wp-includes/rest-api/class-wp-rest-server.php:1028 [PHP 13. WP_REST_Templates_Controller->create_item() /wp-single/wp-includes/rest-api/class-wp-rest-server.php:1181 [PHP 14. WP_REST_Templates_Controller->prepare_item_for_database() /wp-single/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php:400 }}} === Step-by-step reproduction instructions 1. go to /wp-admin/site-editor.php?canvas=view&path=%2Fwp_template_part&postType=wp_template_part then edit the Footer TP for example 2. add a TP block > choose ""start blank"" > then create your TP. This action triggers the PHP notice mentioned above. === Environment * WordPress: 6.1.1, 6.2-beta3-55428 * PHP: 7.2.3 " defect (bug) closed normal 6.3 Editor normal fixed has-patch has-testing-info has-unit-tests needs-testing