Make WordPress Core

Opened 11 years ago

Last modified 7 years ago

#35482 new defect (bug)

Archival pagination fails in 4.4 and up

Reported by: Ipstenu Owned by:
Priority: normal Milestone:
Component: Rewrite Rules Version:
Severity: normal Keywords: needs-unit-tests
Cc: Focuses:

Description

Stemming from research into a weird 'category' issue in #35344

  1. Make your permalinks /%category%/%postname%/ or anything _as long as_ you start with /%category%/
  1. Go to example.com/category/SOMECAT/ and everything works.
  1. Go to example.com/SOMECAT/ and WP thinks it’s an _archive_! And pagination fails. Either it's a 404, or it redirect you to the 'most appropriate' page (I ended up on http://local.wordpress-trunk.dev/page-a/2/ a lot)

I tested this with /%author%/%postname%/ and /bob/%postname%/ - the former had the same issue, the latter shows a 404 for http://local.wordpress-trunk.dev/bob/ and this is expected!

If the permalink 'base' is any of our structure tags ( https://codex.wordpress.org/Using_Permalinks#Structure_Tags ) then WordPress is attempting to generate an archival page for something it knows, and the pagination is failing. Logically this is becuase any ‘base’ page that ​_can_​ generate an archive of itself (cats, tags, dates, but ​_not_​ bob) should be doing so.

Contrary to initial reports, this is a 4.4+ bug, it was _not_ introduced by 4.4.1

Slugs like bob and 'archive' (the slug you get if you pick the 'Numeric' permalink option) have never, that I can see, paginated.

Digging even deeper....

  1. Permalinks set to /%year%/%category%/%postname%/
  1. Visit example.com/2016/SOMECAT and the page displays an archive
  1. Pagination from here does _not_ work (tested on 4.4 and 4.3 so I think its okay to assume that never worked....)

I'm not sure if these should have worked. I know that if you do /%year%/%month%/%postname%/ then the year and the year/month archive URLs will work, but that may be a separate issue.

Change History (6)

#1 @dd32
11 years ago

Contrary to initial reports, this is a 4.4+ bug, it was _not_ introduced by 4.4.1

I'm able to verify the bug under 3.8 - with /%category%/%postname%/ and hitting /uncategorized/ I'm given a category listing whose pagination links to /uncategorized/page/2/ which 404's.

#2 @Ipstenu
11 years ago

I only tested back through the 4.xs. Interesting.

#3 @dd32
11 years ago

Odd, I could verify it in 4.x as well, I just didn't try anything older. I don't think this is a regression, just something that has always "worked" and never been properly handled.

#4 @BrianLF
11 years ago

  • Severity normalmajor

Does anyone know whether this will be fixed quickly, as none of the pages on our site paginate (Blog, News, Events, etc)?

Is this something we'd need a Developer to try to fix, or is this a genuine bug affecting all WordPress sites?

Thanks

#5 @Ipstenu
11 years ago

  • Severity majornormal

@BrianLF - I think you're having https://core.trac.wordpress.org/ticket/35344 and not this issue. This is limited ONLY to archival pages when author or category is the 'base'.

#6 @ocean90
11 years ago

  • Keywords needs-unit-tests added
  • Version 4.4
Note: See TracTickets for help on using tickets.