[wp-trac] [WordPress Trac] #47813: permalinks broken when article name is numeric(if the post id above 1000)

WordPress Trac noreply at wordpress.org
Thu Aug 1 01:32:07 UTC 2019


#47813: permalinks broken when article name is numeric(if the post id above 1000)
-------------------------------+------------------------------
 Reporter:  guigmonteiro       |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Permalinks         |     Version:  5.2.2
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => reporter-feedback


Comment:

 Hi @guigmonteiro, welcome to WordPress Trac! Thanks for the report.

 To clarify a bit, #5305 addressed the issue from two points:
 * [32647] Prevent post slugs that could result in URLs that conflict with
 date archives. (This only applies to permalink structures containing
 `/%postname%/`.)
 * [32648] When parsing what appears to be a date archive request, check
 for a post with a clashing permalink before resolving to the archive.
 * Some follow-up fixes: [33261], [33262], [33630].

 Changing the permalink structure after a post with a 4-digit numeric slug
 is already created seems a bit like an edge case, but [32648] should still
 account for that.

 In my testing, I could not reproduce the issue on a clean install so far.
 My steps:
 1. Switch the permalink structure to a one without `/%postname/`, e.g.
 `/archives/%post_id%`.
 2. Create a post without title. In my case it got the ID of `1864`.
 3. Change the permalink structure to `/%postname%/`.
 4. View the post, it show up as expected (`single.php` template, not the
 archive page).

 Debug Bar plugin shows:
 {{{
 Matched Rewrite Query: year=1864
 Query String: name=1864
 }}}

 So
 [https://developer.wordpress.org/reference/functions/wp_resolve_numeric_slug_conflicts/
 wp_resolve_numeric_slug_conflicts()] seems to work as expected for me,
 correctly rewriting the date query (`year=1864`) to a post query
 (`name=1864`).

 Could you share the ID of the post that doesn't work for you, and the date
 it was published?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47813#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list