Opened 5 months ago
Closed 5 months ago
#60973 closed defect (bug) (duplicate)
PHP Warning in 6.5.2
Reported by: | ivanzhuck | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
Hi,
if your site uses a classic theme which doesn't have directory 'templates', the method 'WP_REST_Templates_Controller::prepare_item_for_response' throws warnings like these:
PHP Warning: Attempt to read property "id" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 647 PHP Warning: Attempt to read property "theme" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 651 PHP Warning: Attempt to read property "content" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 658 PHP Warning: Attempt to read property "content" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 662 PHP Warning: Attempt to read property "slug" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 666 PHP Warning: Attempt to read property "source" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 670 PHP Warning: Attempt to read property "origin" on null in /var/www/site/web/wp/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php on line 674
At the first time, the issue was detected in the version 5.2 and related with the ticked: https://core.trac.wordpress.org/ticket/60915 which marked as 'fixed'.
How to reproduce:
- Install classic theme which doesn't have directory 'templates', but uses 'wp block editor'.
- Open editor for any post.
- The block editor calls rest api method '/wp-json/wp/v2/templates/lookup'.
- While the method is working it throws warnings.
Change History (1)
Note: See
TracTickets for help on using
tickets.
Thanks for the ticket, but this has been reported in #60909