Skip to:

Opened 9 years ago

Closed 8 years ago

#2878 closed defect (bug) (worksforme)

Comments template: Trying to get property of non-object

Reported by: gdragon's profile GDragoN Owned by:
Milestone: Priority: normal
Severity: normal Version: trunk
Component: Appearance - Theme Compatibility Keywords:


When using theme compatibility mode, and if the page.php template loads comments form, comments_form function is trying to load the post. Since theme comaptibility provides dummy post that can have invalid / missing ID, this will trigger following PHP notice:

Trying to get property of non-object
On line: 1050, In file: D:\xampp\htdocs\sites\\wp-includes\comment-template.php
From: require, require_once, include, comments_template, require, comment_form, comments_open

I have attached the patch that will add the dummy post to cache to solve the issue.

Milan Petrovic

Attachments (1)

theme-compat.php.patch (615 bytes) - added by GDragoN 9 years ago.

Download all attachments as: .zip

Change History (3)

#1 @thebrandonallen
9 years ago

  • Keywords reporter-feedback added

I can't reproduce this using the defaul WP themes. Maybe this is any issue with the theme you are using?

#2 @thebrandonallen
8 years ago

  • Keywords has-patch reporter-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Works for me on trunk.

Note: See TracTickets for help on using tickets.