[wp-trac] [WordPress Trac] #46872: Bulk Actions underneath plugins list perform Update when Deactivate chosen

WordPress Trac noreply at wordpress.org
Mon Sep 21 22:08:21 UTC 2020


#46872: Bulk Actions underneath plugins list perform Update when Deactivate chosen
-------------------------------------------------+-------------------------
 Reporter:  clayray                              |       Owner:  garrett-
                                                 |  eclipse
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  5.6
Component:  Quick/Bulk Edit                      |     Version:  2.8
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-dev-   |     Focuses:  ui,
  note                                           |  administration
-------------------------------------------------+-------------------------
Changes (by garrett-eclipse):

 * keywords:  needs-patch => has-patch needs-testing needs-dev-note
 * milestone:  Future Release => 5.6


Comment:

 If at first you don't succeed, Try, try, try again.

 I've uploaded an initial patch
 [https://core.trac.wordpress.org/attachment/ticket/46872/46872.3.diff
 46872.3.diff] to take the alternate approach of marrying the bottom bulk
 action controls with the top ones and removing the submission of action2
 ensuring we're always working off `action` without confusion.

 As this is a JS approach I've disabled the bottom controls on .no-js. I
 left them in the dom instead of injecting the controls as it felt less
 impactful.

 Testing through the list tables in core (Posts, Pages, Media, Comments,
 Plugins, Users, Export and Erasure) I did find a few nuances requiring me
 to stop propagation in order to avoid duplicate confirm alerts as well as
 string some action2 handling in the PHP.

 Do note there remains some references to action2 in core as they're
 unrelated to this specific change and would break their function. These
 currently are;
 1. Handling the multisite confirm action it uses action2 along with action
 to pass it's request through via URL (not bulk actions). This is in;
 `/wp-admin/includes/class-wp-ms-sites-list-table.php` &  `/wp-
 admin/network/sites.php`
 2. Some PHPUnit testing framework for action hook testing found in;
 `/tests/phpunit/includes/utils.php` & `/tests/phpunit/tests/actions.php`
 3. Some references in the @wordpress npm package; `@wordpress/data/src
 /namespace-store/test/index.js` and `@wordpress/data/src/test/registry.js`

 This is working pretty nicely for me right now, would love some
 review/testing if you have time @johnbillion @SergeyBiryukov @whyisjake

 P.S. For now I only hide the bottom bulk actions but left the bottom
 actions container visible for plugins use. We may want to look at making
 this work agnostically so any bottom control is married to it's primary
 counterpart.

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


More information about the wp-trac mailing list