#9676 closed defect (bug) (fixed)
Bulk action request not properly caught
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8 | Priority: | normal |
| Severity: | normal | Version: | 2.7.1 |
| Component: | Media | Keywords: | |
| Focuses: | Cc: |
Description
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:
- navigate to /wp-admin/upload.php (add ?detached=1 to test mass-attach function).
- use the bulk action button at the bottom of this page.
- "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.
Change History (8)
#2
@
17 years ago
- Component changed from General to Media
- Keywords needs-patch added
- Owner anonymous deleted
#3
@
17 years ago
Unable to reproduce (upload.php, action at bottom).
Unable to reproduce (upload.php?detached=1, action at bottom).
javascript is switched ON. maybe this does not work with javascript switched OFF?
#4
@
17 years ago
- Keywords needs-patch removed
- Resolution set to worksforme
- Status changed from new to closed
With javascrip switched OFF, there is no message. Since I think the Fallback Notice function has disappeared from ACP there is not taken care of anyway. So worksforme.
#6
@
17 years ago
- Milestone set to 2.8
- Resolution worksforme deleted
- Severity changed from minor to normal
- Status changed from closed to reopened
- Version set to 2.7.1
hakre, is the first <select> set to empty when you're testing ?
look at this bit from the code I quote:
$('select[name^="action"]').val()
it will only visit the FIRST <select> element within a page (despite the careful consideration gone into catching any <select> with name="action*")
but there are TWO <select> elements on /wp-admin/upload.php, one for each apply button.
on a second thought, a more accurate description should be
It only caught the first select form, which has name "action".
So regardless of which submit button we use, the script only caught the value of first select form... still a defect, but minor.