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

WordPress Trac noreply at wordpress.org
Mon Apr 15 06:55:17 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:  Quick/Bulk Edit           |     Version:  trunk
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |     Focuses:  ui, administration
--------------------------------------+---------------------------------

Comment (by subrataemfluence):

 @garrett-eclipse I should have been more elaborate when tested. You are
 right. Your way allowed me to reproduce the issue.

 My proposal is that if we can rewrite the current function in the
 following way, it will solve the issue.

 {{{#!php
 <?php
 public function current_action() {
   if ( isset( $_REQUEST['filter_action'] ) && ! empty(
 $_REQUEST['filter_action'] ) ) {
     return false;
   }

   $action1 = '';
   $action2 = '';

   if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] ) {
     $action1 = $_REQUEST['action'];
   }

   if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] ) {
     $action2 = $_REQUEST['action2'];
   }

   if( $action1 === $action2 ) {
     return $action1;
   }

   return false;
 }
 }}}


 However, we need to have a proper `AdminNotice`, something like

 `You have selected different actions. Operation cannot be performed.`

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


More information about the wp-trac mailing list