[wp-trac] [WordPress Trac] #29615: Non-Page Hierarchical Post Type 'Default Permalinks' do not work for child posts

WordPress Trac noreply at wordpress.org
Mon Sep 15 16:55:07 UTC 2014


#29615: Non-Page Hierarchical Post Type 'Default Permalinks' do not work for child
posts
------------------------------+--------------------
 Reporter:  loushou           |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  4.0.1
Component:  Permalinks        |     Version:  4.0
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+--------------------

Comment (by loushou):

 @netweb - the answer to your question is, I'm not entirely sure, in
 practice. as I mentioned before the plugin has been in active use for
 quite a while, but only on sites that have a pretty permalink structure;
 however, take a look at the next response below.

 @SergeyBiryukov - thanks for taking a look into this. I have tested this
 directly in version 4.0, 3.9.2, 3.8.1, 3.8.0, 3.6.1, 3.6.0, 3.5.2, 3.5.0,
 3.4.2, & 3.2.1. this problem, if reproduced following my outlined list of
 steps, is present in _all_ of those versions. most of the relevant code
 across all those versions has not changed.
 no major changes (or even minor changes really) in the permalink
 generation function across all those version ( get_post_permalink() ).
 there have also been no major changes (or minor changes) to the
 wp_query->get_posts() function dealing with the pagename query_var across
 all those versions. the get_page_by_path() however, has several major
 changes over the course of the mentioned versions.
 in all the above versions I can follow these steps and produce one of the
 two problems we have discovered, the original problem I reported (the 404)
 and the problem that you identified (wrong post displayed):
 - verify the 'default permalinks'
 - create the post type
 - create a parent post named 'parent-post'
 - create a child post of parent-post, called 'child-post'
 - create a parent post named 'child-post'
 - attempt to browse to the child post called 'child-post'
 - some versions i get a 404, some versions i get the parent post named
 'child-post'
 I have not tested version 3.9.0, so there may very well have been a 1 or 2
 version change that solves it for those versions, but i have tested this
 issue in all the versions in the above list, and they _all_ have one of
 the two problems.
 Again, thanks for verifying that this is a problem, and that my patch
 works. Also thanks a bunch for adding the unit test, because that will
 ensure that this does not continue to slip through the cracks. You have
 been a great help man.

 Loushou

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


More information about the wp-trac mailing list