Opened 12 years ago
Closed 8 years ago
#17413 closed defect (bug) (fixed)
Code added by WP_List_Table::_js_vars is duplicated
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Administration | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
When a list table is 'ajax enabled' (e.g. comments list table on edit-comments.php), javascript code is added by WP_List_Table::_js_vars to the footer. If you look at the source code in your browser, you will see that code is duplicated.
Attachments (2)
Change History (8)
#2
@
12 years ago
- Keywords has-patch added; needs-patch removed
Attached patch fixes the issue but I am not sure if it breaks something else.
#5
@
9 years ago
- Focuses administration added
It seems this patch would be a good candidate for inclusion in core, and the patch doesn't need to be refreshed.
Note: See
TracTickets for help on using
tickets.
The problem is that two instances of the List_Table class are created while loading the page, and each time the constructor hooks
$this->_js_vars
toadmin_footer
. In the case ofedit-comments.php
:wp-admin/edit-comments.php:14
and then again in wp-admin/includes/template.php:337
I wonder if there isn't a fundamental problem here in that we are creating multiple list tables instances when we should be using only one. Certainly the current js stuff assumes there is only one list table.