Opened 14 years ago
Closed 14 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
Note: See
TracTickets for help on using
tickets.
(In [14829]) Check to see we have posts before calling the_post(). Fixes #13510 props dd32.