[wp-trac] [WordPress Trac] #17413: Code added by WP_List_Table::_js_vars is duplicated

WordPress Trac wp-trac at lists.automattic.com
Fri May 13 10:53:30 UTC 2011


#17413: Code added by WP_List_Table::_js_vars is duplicated
--------------------------------------+------------------------------
 Reporter:  sorich87                  |       Owner:  sorich87
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Administration            |     Version:  3.2
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+------------------------------
Changes (by solarissmoke):

 * keywords:  needs-patch => needs-patch dev-feedback


Comment:

 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` to `admin_footer`. In the case of `edit-comments.php`:

 wp-admin/edit-comments.php:14
 {{{
 $wp_list_table = _get_list_table('WP_Comments_List_Table');
 }}}

 and then again in wp-admin/includes/template.php:337
 {{{
 $wp_list_table = _get_list_table('WP_Comments_List_Table');
 }}}

 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17413#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list