[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
Fri Dec 9 09:03:39 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                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  administration
----------------------------------------+------------------------------
Changes (by engelen):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 @chris_dev Thanks, the patch solves the problem for most objects.

 Close inspection reveals that `WP_Terms_List_Table` overrides
 `get_current_action()` from `WP_List_Table`, and handles bulk deletion of
 terms wrongly. It doesn't check which "Apply" button is clicked when
 deleting terms, and deletes the selected term if either of them is clicked
 and either of the dropdowns was set to "Delete". This wasn't as big a
 problem as it is since 4.7, when custom bulk actions were introduced. As
 such, it can lead to '''unintended permantent deletion of terms'''.
 Somewhat major, if I were to judge it.

 Furthermore, the same problem exists with user promotion on the users
 overview. Here, the role selection from the bottom dropdown overrides the
 role selection from the top dropdown, even if the top apply button is
 clicked.

 Patch "39186.diff" addresses builds on the patch of @chris_dev and
 addresses the other issues. I would suggest to add (more?) unit tests to
 the bulk actions functionality, as these problems are bound to pop up more
 from 4.7 onward.

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


More information about the wp-trac mailing list