[wp-trac] [WordPress Trac] #12755: Detached media sorted in reverse by date

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 29 06:25:55 UTC 2010


#12755: Detached media sorted in reverse by date
----------------------------+-----------------------------------------------
 Reporter:  sbressler       |       Owner:                          
     Type:  defect (bug)    |      Status:  new                     
 Priority:  normal          |   Milestone:  Unassigned              
Component:  Administration  |     Version:  3.0                     
 Severity:  normal          |    Keywords:  media, ordering, sorting
----------------------------+-----------------------------------------------
 Media that's unattached to any post (i.e. at this page: "/wp-
 admin/upload.php?detached=1" for a WP install) seems to be sorted by
 post_date ascending (starting with the oldest media) rather than
 descending. I was able to replicate this in WP 2.9.1, WP 2.9.2 MU and WP
 3.0.

 I couldn't quite find the correct line to fix, but line 305 of media.php
 does correct sorting:
 {{{
 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date)
 AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY
 post_date DESC";
 }}}
 So it must be somewhere else since that query doesn't run if loading
 detached media.

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


More information about the wp-trac mailing list