[wp-trac] [WordPress Trac] #18962: Allow duplicate slugs for different content

WordPress Trac noreply at wordpress.org
Mon Nov 24 15:41:36 UTC 2014


#18962: Allow duplicate slugs for different content
--------------------------------------+-----------------------------
 Reporter:  maorb                     |       Owner:  wonderboymusic
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  4.1
Component:  Permalinks                |     Version:  2.9
 Severity:  major                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:  has-patch commit has-unit-tests => has-patch has-unit-tests


Comment:

 > It does however seem like a edgecase that should be considered, creating
 a page that conflicts with a existing image attachment at that url level
 seems wrong. Especially considering that attachments uploaded after the
 page is created will avoid that clash.

 Agreed. [attachment:18962.patch] is my suggested fix. It implements dd32's
 suggestion that `wp_unique_post_slug()` check attachments as well as the
 same post_type for post_name clashes. As noted, this breaks
 `test_get_page_by_path_priority()`, because in the process of setting up
 fixtures, you can no longer natively create a page and attachment with the
 'some-page' slug. So I suggest directly updating the DB in order to
 replicate the (legacy) situation where you have an attachment/page
 conflict, so that the `get_page_by_path()` fix continues to be tested.

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


More information about the wp-trac mailing list