Opened 8 years ago
Closed 8 years ago
#1408 closed defect (bug) (fixed)
comments_popup_link() returns incorrect URI when there are zero comments [patch]
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | General | Version: | 1.5.1.1 |
| Severity: | minor | Keywords: | comments link bg|commit bg|has-patch |
| Cc: |
Description
When popup comments are disabled, the function comments_popup_link() echos the URI permalink#comments even when there are no comments present. In the default template the heading with the id #comments does not exist on the page until the first comment has been submitted. When there are zero comments, comments_popup_link() should echo permalink#respond instead.
My fix for this is as follows:
In comment-functions.php, replace line 121...
comments_link();
with the following...
if (0 == $number) {
echo get_permalink() . '#respond';
} else {
comments_link();
}
Attachments (1)
Change History (7)
comment:1
Kafkaesqui — 8 years ago
comment:2
markjaquith — 8 years ago
- Keywords comments link added
- Owner changed from anonymous to matt
Sounds good to me. I made a patch for 1.5 branch
comment:3
markjaquith — 8 years ago
- Owner changed from matt to markjaquith
- Status changed from new to assigned
- Summary changed from comments_popup_link() returns incorrect URI when there are zero comments to comments_popup_link() returns incorrect URI when there are zero comments [patch]
comment:4
markjaquith — 8 years ago
- Owner changed from markjaquith to matt
- Status changed from assigned to new
comment:5
markjaquith — 8 years ago
- Keywords bg|commit bg|has-patch added
- Owner changed from matt to markjaquith
- Status changed from new to assigned
Note: See
TracTickets for help on using
tickets.

This problem exists in the non-popup default comments template as well.