[wp-trac] [WordPress Trac] #24817: If POST and PAGE have the same slug then PAGE record will be found even if it has been TRASHed

WordPress Trac noreply at wordpress.org
Mon Jul 22 14:32:01 UTC 2013


#24817: If POST and PAGE have the same slug then PAGE record will be found even if
it has been TRASHed
--------------------------+-----------------------------
 Reporter:  lwoods        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  3.5.2
 Severity:  major         |   Keywords:  needs-patch
--------------------------+-----------------------------
 WP 3.5.2
 I set my permalinks to "postname" and then added a POST to a menu.  It
 turns out I had previously had a PAGE with the same name, but I had
 TRASHed it.  But when I clicked on the menu link I got a "404".  I traced
 the queries and it looks like the query only looks for the slug value and
 does NOT test for whether the slug name has been trashed.
 This can be reproduced by adding a page with the title "Test Page" which
 will create a slug "test-page".  Publish it, then trash it.  Now, create a
 POST with the title "Test Page" and publish it.  Go check the database.
 There are two entries in the database with a post_name of "test-page".
 Now add a menu entry for the POST "Test Page".  When clicking on this menu
 entry you will get a "404".  That's because WP is trying to load the PAGE
 with a slug of "test-page" and there isn't one.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24817>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list