Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#49171 new defect (bug)

Trying to get property 'post_type' of non-object in wp-includes/link-template.php on line 682

Reported by: ronald2020's profile ronald2020 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Feeds Keywords: needs-patch
Focuses: template Cc:

Description

Hi there,

I believe this maybe a bug or at least an unchecked condition (post/page does not exist) throwing the above error. I have legit crawlers visiting that cause these errors.

Running 5.3.2. All plugins disabled (except for Health Check & Troubleshooting). Theme: Twenty.

How to re-produce : https://your.site.com/news2020/feed/atom/

It is key that the slug for the post/page does NOT (NO longer) exists.

Stack trace:

  1. {main}() /Users/me/root/index.php:0
  2. require() /Users/me/root/index.php:17
  3. require_once() /Users/me/root/wp-blog-header.php:19
  4. do_action() /Users/me/root/wp-includes/template-loader.php:13
  5. WP_Hook->do_action() /Users/me/root/wp-includes/plugin.php:478
  6. WP_Hook->apply_filters() /Users/me/root/wp-includes/class-wp-hook.php:312
  7. redirect_canonical() /Users/me/root/wp-includes/class-wp-hook.php:288
  8. is_front_page() /Users/me/root/wp-includes/canonical.php:498
  9. WP_Query->is_front_page() /Users/me/root/wp-includes/query.php:456
  10. WP_Query->is_page() /Users/me/root/wp-includes/class-wp-query.php:3879

PHP Notice: Trying to get property 'post_type' of non-object in /Users/me/root/wp-includes/link-template.php on line 682

A variant (same sort of problem) throws an error in class-wp-query.php with the following:

https://your.site.com/news2020/feed/


Change History (1)

#1 @MadtownLems
5 years ago

A variant (same sort of problem) throws an error in class-wp-query.php with the following:
https://your.site.com/news2020/feed/

You can find more information on this particular bit on this ticket: https://core.trac.wordpress.org/ticket/29660

Note: See TracTickets for help on using tickets.