Opened 16 years ago
Closed 16 years ago
#13510 closed defect (bug) (fixed)
TwentyTen: Empty archives result in PHP Notices
| Reported by: | dd32 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Themes | Version: | 3.0 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [14829]) Check to see we have posts before calling the_post(). Fixes #13510 props dd32.