Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#13086 closed defect (bug) (fixed)

Paginated comments return a 404 with custom post types

Reported by: greenshady Owned by: dd32
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Posts, Post Types Keywords:
Focuses: Cc:


When using paginated comments with a custom post type, clicking on a comment permalink or a comment page gives a 404.

Steps to reproduce:

  • Create a custom post type.
  • Set the comments per page under Discussion Settings.
  • Create enough comments for pagination on the singular view of a "post".

Change History (3)

#1 @dd32
6 years ago

  • Keywords needs-patch removed
  • Owner set to dd32
  • Status changed from new to accepted

Confirmed that Custom post types do not receive the comment paging rewrite rules.

Comes down to our nice friend, Rewrite Endpoint bitmasks, Turns out, EP_NONE will not receive comment paging links, as EP_NONE & EP_NONE == 0, which results in it being skipped over..

Obvious solution here is to change custom post url's from EP_NONE to EP_PERMALINK, which should be alright considering that they're Permalinks to objects.

#2 @dd32
6 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [14219]) Change custom post_type default Rewrite endpoint mask to EP_PERMALINK to ensure comment paging rules are added. Removes redundant/non-usable EP_NONE branch. Fixes #13086

#3 @dd32
6 years ago

This will result in all post types receiving paging rewrite rules regardless of if they support comments. A smarter rewrite generation system is needed and has been discussed elsewhere such as #12779

Note: See TracTickets for help on using tickets.