[wp-trac] [WordPress Trac] #39186: Bulk actions not correctly applied when selecting bulk actions in both the top and bottom bulk actions dropdowns

WordPress Trac noreply at wordpress.org
Thu Dec 8 14:48:45 UTC 2016


#39186: Bulk actions not correctly applied when selecting bulk actions in both the
top and bottom bulk actions dropdowns
-----------------------------+-----------------------------
 Reporter:  engelen          |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Quick/Bulk Edit  |    Version:  4.7
 Severity:  normal           |   Keywords:
  Focuses:  administration   |
-----------------------------+-----------------------------
 In `WP_List_Table` objects, the bulk actions dropdown and "Apply" button
 is displayed twice: once below the table and once above the table. The
 `name` attribute of the bulk actions dropdown element is always set
 "action". This wouldn't be a problem if the top and bottom actions were
 two in different forms.

 However, both dropdown elements are in the `posts-filter`-form. You can
 start to see the problem here. Two form elements both have the same name,
 which yields unexpected behaviour when trying to apply bulk actions.

 Take the following use case, for example:
 - Select some posts from the posts list in `/wp-admin/edit.php`.
 - Select "Edit" from the bulk actions dropdown above the list table.
 - Select "Move to Trash" from the dropdown below the list table.
 - Click the apply button next to the dropdown on the bottom of the list
 table.
 - The submit request is sent. You would expect the posts to be moved to
 the trash, but instead, nothing happens.

 Screencast of bug: http://recordit.co/EjHAbw2KNr

 The solution I see would rename the dropdowns for the top and bottom
 dropdowns (they already have different names) and name the "Apply"
 buttons. Then, when one of the buttons is pressed, execute the
 corresponding bulk action.

 In any case, we shouldn't have any two form elements with the same name in
 a single form.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39186>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list