WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#13510 closed defect (bug) (fixed)

TwentyTen: Empty archives result in PHP Notices

Reported by: dd32 Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Themes Keywords:
Focuses: Cc:

Description

Hit a page which will display no posts (but is a valid page), for example /custom_taxonomy/empty_term/ archive.php will cause a PHP notice to be raised due to calling the_post() without first checking if posts exist.

Warnings produced:

Notice: Undefined offset: 0 in C:\www\davis\wp-includes\query.php on line 2551

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2845

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2847

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2849

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2850

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2857

Notice: Trying to get property of non-object in C:\www\davis\wp-includes\query.php on line 2868

Change History (1)

comment:1 westi4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14829]) Check to see we have posts before calling the_post(). Fixes #13510 props dd32.

Note: See TracTickets for help on using tickets.