[wp-trac] [WordPress Trac] #46872: Bulk Actions underneath plugins list perform Update when Deactivate chosen
WordPress Trac
noreply at wordpress.org
Sat Apr 13 19:42:19 UTC 2019
#46872: Bulk Actions underneath plugins list perform Update when Deactivate chosen
--------------------------------------+---------------------------------
Reporter: clayray | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch dev-feedback | Focuses: ui, administration
--------------------------------------+---------------------------------
Changes (by garrett-eclipse):
* keywords: needs-patch => needs-patch dev-feedback
Comment:
Looking into the code it appears this issues comes from the parent
`WP_List_Table` class in `wp-admin/includes/class-wp-list-table.php` here;
https://github.com/WordPress/WordPress/blob/7a617078fa7674f2062379b961daba412875ab9e
/wp-admin/includes/class-wp-list-table.php#L492-L498
{{{#!php
<?php
if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
return $_REQUEST['action'];
}
if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
return $_REQUEST['action2'];
}
}}}
So if the first bulk selector is set it's action takes precedence
irregardless of the secondary action.
There's a few avenues we can take to resolve this.
1. Tie the two selectors together so changes to one apply to the other
meaning they'll always submit the same value.
2. Depending on which Apply is used unset the other bulk action selector
so it's value being submitted is -1 allowing the second action to act.
3. Introduce a hidden input which gets the currently acted upon selectors
value mapped to it just before submit.
Adding `dev-feedback` to get input on the above.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46872#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list