Opened 3 years ago

Last modified 8 months ago

#11694 accepted defect (bug)

WP should do sanity checks for paginated posts, pages and comments

Reported by: Denis-de-Bernardy Owned by: dd32
Priority: normal Milestone: Future Release
Component: Template Version: 2.9
Severity: major Keywords: has-patch
Cc: sirzooro

Description

Create a post with two pages using the <!--nextpage--> tag. Publish, and browse the post's *third* page.

WP should return a 404 here, rather than the last page of the post.

Along the same lines, it should return the correct canonical urls for paginated posts. Currently, rel=canonical will only ever return the post's first page.

Attachments (1)

11694.diff (803 bytes) - added by dd32 3 years ago.

Download all attachments as: .zip

Change History (10)

  • Version set to 2.9
  • Summary changed from WP should do sanity check for paginated posts and pages to WP should do sanity checks for paginated posts and pages

comment:3   elky3 years ago

The rel=canonical issue really ought to be split out in to a separate bug, imho.

comment:4   dd323 years ago

  • Keywords has-patch added
  • Milestone changed from 3.0 to 3.1
  • Owner set to dd32
  • Status changed from new to accepted

I'm attaching a patch I've got locally for this.

This will need a more thought out patch however.

dd323 years ago

  • Milestone changed from Awaiting Triage to Future Release

Closed #21278 as a duplicate. Related: #11857 (for archive pages).

As noted in ticket:21278:9, paginated comments are affected too.

Last edited 9 months ago by SergeyBiryukov (previous) (diff)
  • Cc sirzooro added

See also #21579 where a similar issue occurs with paged comments. Invalid comment pages, for example http://example.com/content/comment-page-999/ do not return a 404 but equally do not find any comments! Is a new ticket needed or can we use this one to fix the 404 issue in both cases and #21579 to generate the proper rel="canonical" in both cases?

  • Summary changed from WP should do sanity checks for paginated posts and pages to WP should do sanity checks for paginated posts, pages and comments

Replying to mdgl:

Is a new ticket needed or can we use this one to fix the 404 issue in both cases

No need for a new ticket. Updated the summary.

Note: See TracTickets for help on using tickets.