WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 4 months ago

#26133 closed defect (bug) (fixed)

Comment permalinks in notification emails should include pagination

Reported by: eatingrules Owned by: nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: has-patch
Focuses: Cc:

Description

[This is my first time submitting a trac ticket - I apologize if I'm not doing it correctly. I searched the support forms (and posted a week ago but got no response), and have searched the trac for existing tickets, but didn't turn up anything that matched. Thanks!]

In Settings->Discussion, we have "Break Comments into pages with 25 top level comments per page and the last page displayed by default. We also have comments should be displayed with the older comments at the top of each page.

When a comment is first left by the reader, there may already be several pages of comments. The comment initially will appear on the default page (because we have the last page displayed by default), so the pagination is not necessary in the permalink:

http://oursite.com/blog-post/#comment-12345

However, by the time our moderator clicks the link, there have usually been several more pages of comments - so the anchor #comment-12345 doesn't do any good (because the original comment is no longer on the most recent page). She then has to page through the comments manually to find the comment, which is time-consuming and frustrating.

It would be far preferable for the permalink in the email notification to include the fully paginated link:

http://oursite.com/blog-post/comment-page-5/#comment-12345

Attachments (1)

pluggable.php.patch (611 bytes) - added by eatingrules 6 months ago.
Add pagination to comment permalink in emails

Download all attachments as: .zip

Change History (8)

comment:1 SergeyBiryukov8 months ago

  • Component changed from General to Comments

comment:2 jeremyfelt8 months ago

  • Version changed from 3.7.1 to 3.1

Thanks for the ticket submission, @eatingrules. No worries on process, you did great with the description. I'm not able to find a duplicate ticket either and this does sound like an interesting issue.

For reference, direct links to the comments were added through #12797 in 3.1.

At first glance, there may be a way for us to use get_comment_link() when generating the notification rather than the current get_permalink().

I do wonder how we would handle comments that change pages as moderation occurs. Links in the email may still be incorrect at some point.

comment:3 eatingrules8 months ago

I previously tried to find more info on the get_comment_link() function in the codex, but it didn't indicate if it includes the pagination in the link by default. If so, maybe it really is as simple a change as using that instead of get_permalink() in the emails?

You make a good point about pagination changes from commend moderation - though for us that's a lesser concern because it happens less often. However, perhaps a solution is to have a permalink+redirection system in place? There could be a standardized comment permalink URL generated, which then redirects to the current comment location.

Something like...

http://oursite.com/comments/comment-12345

...which would then cause a database lookup to figure out where to redirect to, and then issues a 301 redirect to the current location of the comment:

http://oursite.com/blog-post/comment-page-5/#comment-12345

Last edited 8 months ago by eatingrules (previous) (diff)

eatingrules6 months ago

Add pagination to comment permalink in emails

comment:4 eatingrules6 months ago

I recently went ahead and modified pluggable.php to make this work for our assistant who responds to comments. Now the comment links in our email notifications include pagination, and are far more useful.

Just uploaded a patch for review! :)

comment:5 SergeyBiryukov5 months ago

#27161 was marked as a duplicate.

comment:6 SergeyBiryukov5 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.9

comment:7 nacin4 months ago

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

In 27567:

Use get_comment_link() in wp_notify_postauthor().

Fixes pagination for the link directly to the moderated comment.

props eatingrules.
fixes #26133.

Note: See TracTickets for help on using tickets.