Opened 14 years ago
Closed 14 years ago
#17316 closed defect (bug) (fixed)
Don't 404 on empty post type archives
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Posts, Post Types | Keywords: | needs-testing needs-patch |
Focuses: | Cc: |
Description
Like the title says, we shouldn't 404 on empty post type archives, just like we don't 404 for empty tag, category, taxonomy or author archives. I have attached a patch.
Attachments (3)
Change History (20)
#5
follow-up:
↓ 7
@
14 years ago
We very well could, since if there is a queried object, it shouldn't be a 404.
#7
in reply to:
↑ 5
@
14 years ago
Replying to jfarthing84:
We very well could, since if there is a queried object, it shouldn't be a 404.
Not sure about that -- the conditionals removed in that patch, even when including is_post_type_archive(), is a subset of what's checked in get_queried_object().
#8
@
14 years ago
So? In which case would we want to send a 404 header that would also have queried_object set?
#10
@
14 years ago
- Keywords commit added
- Milestone changed from Future Release to 3.2
Restoring per bug scrub. Suggest commit on 17316.diff.
#12
@
14 years ago
Tested 17316.diff against bbPress 2.0, with and without pretty permalinks, and works great. I think this is the desired result and would love for this to make it into 3.2. A few support topics of bbPress 2.0 beta have come through where an empty topics archive page 404's rather than shows the "No Topics found" feedback, and this alleviates that.
#13
@
14 years ago
- Owner set to nacin
- Resolution set to fixed
- Status changed from new to closed
In [18192]:
#14
@
14 years ago
- Keywords needs-testing needs-patch added; has-patch commit removed
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 3.1 to 3.2.1
The problem is still present:
"../news/archives/2010/09/29" redirects to a 404 Error because there are no posts that day.
#15
@
14 years ago
- Version changed from 3.2.1 to 3.1
Please do not change the version number. It's there to track when the bug was introduced/reported.
I might be wrong, but shouldn't it be
if ( ( is_tag() || is_category() || is_tax() || is_author() || is_post_type_archive() ) && $wp_query->get_queried_object() && !is_paged() ) {
so thatis_post_type_archive()
is included within theif
statement like the others? :)