[wp-trac] [WordPress Trac] #12448: pagination problem in unattached media page
WordPress Trac
wp-trac at lists.automattic.com
Mon Mar 22 06:39:09 UTC 2010
#12448: pagination problem in unattached media page
-------------------------------+--------------------------------------------
Reporter: Denis-de-Bernardy | Owner: matdumsa
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: 2.9.3
Component: Administration | Version: 2.9.2
Severity: normal | Keywords: has-patch
-------------------------------+--------------------------------------------
Changes (by matdumsa):
* keywords: needs-patch => has-patch
Comment:
Actually I found the problem..
It lies in wp-admin/upload.php
It seems that the pagination system used by the media is the same as the
one used for POSTS.. It relies on information usually provided by the user
in the $_GET variable (query string).
The code for everything BUT orphan is the same.. all it does is call
wp_edit_attachments_query() which hack the $_GET array into thinking that
these values (posts_per_page) where provided.. In our case these values
were unset so this is why you see 0..
The attached patch makes the “hack” work even for unattached elements..
BTW this whole pagination code is pretty ugly.. Maybe a re-write would be
require to avoid such bugs in the future..
Enjoy
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12448#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list