[wp-trac] [WordPress Trac] #9676: Bulk action request not properly caught

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 29 07:49:37 GMT 2009


#9676: Bulk action request not properly caught
--------------------------+-------------------------------------------------
 Reporter:  gmpfree       |       Owner:  anonymous
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.8      
Component:  General       |     Version:           
 Severity:  normal        |    Keywords:           
--------------------------+-------------------------------------------------
 '''description''':

 the bulk action button ''at the bottom'' of Media Library is not working
 as intended.

 '''symptom''':

 no warning alert before mass-delete & unable to mass-attach images to a
 post.

 '''steps to reproduce''':

 1. navigate to /wp-admin/upload.php (add ?detached=1 to test mass-attach
 function).

 2. use the bulk action button ''at the bottom'' of this page.

 3. "delete" will produce no alert; "attach" will only refresh the page.

 '''Cause''':

 {{{
 <div class="alignleft actions">
 <select name="action2" class="select-action">
 <option value="-1" selected="selected">Bulk Actions</option>
 <option value="delete">Delete</option>
 <option value="attach">Attach to a post</option>
 </select>
 <input type="submit" value="Apply" name="doaction2" id="doaction2" class
 ="button-secondary action" />
 </div>

 }}}


 select form at the bottom has name "action2", which is not caught by the
 following code on the same page.

 {{{
 (function($){
         $(document).ready(function(){
                 $('#doaction, #doaction2').click(function(e){
                         if ( $('select[name^="action"]').val() == 'delete'
 ) {
                                 var m = 'You are about to delete the
 selected attachments.\n  \'Cancel\' to stop, \'OK\' to delete.';
                                 return showNotice.warn(m);
                         } else if ( $('select[name^="action"]').val() ==
 'attach' ) {
                                 e.preventDefault();
                                 findPosts.open();
                         }
                 });
         });
 })(jQuery);
 }}}

 I haven't had the time to digg out where the code lies though.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9676>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list