[wp-trac] [WordPress Trac] #12634: Media Library & Permalink Overlap

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 14 19:39:26 UTC 2010

#12634: Media Library & Permalink Overlap
 Reporter:  tmoorewp       |       Owner:  ryan             
     Type:  defect (bug)   |      Status:  new              
 Priority:  normal         |   Milestone:  Awaiting Review  
Component:  Rewrite Rules  |     Version:                   
 Severity:  normal         |    Keywords:  reporter-feedback
Changes (by madtownlems):

 * cc: madtownlems (added)


 I can easily replicate this error on both 2.9.1 and 3.0.1.  Here's my
 (overly detailed) write up:

 When you upload a media item, it creates a permalink for the piece of
 media.  (you can view the permalink by hovering over View for the media
 link in the media library)
 -       If you upload it from the left menu “Media – Add New” the
 permalink will look like:  blah.com/?attachment_id=57
 -       If you upload while creating/editing a page, the permalink will
 use the structure:  blah.com/<path-to-page>/image-title
 If the permalink is already taken, say as by an existing page, it will
 make it unique by appending something like “-2” to the end.

 When you create a new page, it generates a permalink in the form of <path-

 HOWEVER – and herein lies the problem – it does NOT check if the permalink
 is taken by an existing media item (but it DOES compare it against
 existing page permalinks).

 So, in order to experience the problem, I believe the following all need
 to be true:
 1)      You add the media via the Upload/Insert link while creating the
 2)      You upload the images BEFORE you create the pages
 3)      The pages have the same title as the image title

 Steps to Recreate Example:
 Create page /tool
 Create page /tool/hammer
 Edit /tool. Add images called hammer.jpg and saw.jpg, link hammer.jpg to
 /tool/hammer and saw.jpg to /tool/saw
 Create page /tool/saw

 Expected behavior:
 /tool/hammer  should take you to the page itself
 /tool/saw should display the saw.jpg instead of the page
 Desired behavior:
 /tool/saw should display the saw page.

Ticket URL: <http://core.trac.wordpress.org/ticket/12634#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list