[wp-trac] [WordPress Trac] #33523: WP_List_Table sortable header links break when list table is loaded via Ajax
WordPress Trac
noreply at wordpress.org
Sun Aug 23 22:43:11 UTC 2015
#33523: WP_List_Table sortable header links break when list table is loaded via
Ajax
----------------------------+-----------------------------
Reporter: McGuive7 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: trunk
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
When using Ajax to load up a WP_List_Table with sortable columns, the
column header links are broken and point to admin-ajax.php instead of the
actual current URL.
This appears to be due to the following line in wp-admin/includes/class-
wp-list-table.php:
{{{
$current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] .
$_SERVER['REQUEST_URI'] );
}}}
Checking the $_SERVER variable returns the current request info, which is
via admin-ajax.php, not the actual URL (current admin page) from which the
Ajax request is made. This completely breaks column sorting for list
tables loaded via Ajax, with the column header links pointing to something
like: `http://local.wordpress-trunk.dev/wp-admin/admin-
ajax.php?orderby=version&order=asc` instead of the proper URL.
Here's a screencast for clarity: http://recordit.co/DSsXlaUuka
Is there a workaround for this one? If not, it seems like a bug, right?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33523>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list