Opened 14 years ago
Last modified 6 years ago
#16165 assigned enhancement
Media Library Bulk Delete: Error in deleting...
Reported by: | hakre | Owned by: | nacin |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Media | Keywords: | has-patch dev-feedback |
Focuses: | administration | Cc: |
Description
While Bulk Deletion, when a user gets the "Error in deleting..." message, there is no information given of how many elements have been deleted so far.
Let's say there was a bulk of N deletions, getting this error can mean up to N-1 items have been deleted already.
Same is the case if for some item, no permissions are granted to delete it. The number of successfully deleted items is missing as well.
Attachments (3)
Change History (17)
#1
@
14 years ago
- Component changed from General to Media
- Type changed from defect (bug) to enhancement
#2
@
14 years ago
- Summary changed from Media Library Bulk Delete: Error in deleting... / You are not allowed to delete this post. is not given any information about the amount of successfully deleted items. to Media Library Bulk Delete: Error in deleting...
#3
@
14 years ago
- Milestone changed from Awaiting Review to Future Release
- Priority changed from normal to low
#4
@
14 years ago
- Keywords has-patch dev-feedback added
This patch reports exactly which items failed to trash/untrash/delete for bulk edits.
#5
@
12 years ago
- Cc bpetty added
I have attached an updated patch against latest SVN trunk. Besides updating it though, I also made 3 fixes to the old patch.
- Added esc_html filter for titles in error messages (required for security).
- Fixed usage of WP_Error so it doesn't add a blank error first incorrectly (when there is at least one error).
- The get_post() check actually needed to be negated in order to properly skip over items that were in fact deleted already, and also so that bulk item deletion actually worked properly (the original patch made it impossible to delete items using bulk deletion).
This patch, like the original, is a fix for both #16165 as well as #16164.
#7
@
12 years ago
- Milestone changed from Future Release to 3.5
Looks good. If you try to delete a few hundred posts and they all fail for some reason, is it necessary to error that every one of them couldn't be deleted? At some point should we just show a number, if count( $errors ) is too high, or if there were no successes at all?
#8
@
12 years ago
- Owner set to nacin
- Status changed from new to assigned
New patch added that only shows the count of the number of items that failed if it's greater than 10 items. Also fixed some spacing to adhere to coding guidelines.
#9
follow-up:
↓ 11
@
12 years ago
- Milestone changed from 3.5 to Future Release
From the patch:
// Escape item titles displayed in error messages. add_filter( 'the_title', 'esc_html' );
Why is that needed?
And I agree with Westi that we should handle this for all list screens. Punting.
#11
in reply to:
↑ 9
@
12 years ago
Replying to scribu:
From the patch:
// Escape item titles displayed in error messages. add_filter( 'the_title', 'esc_html' );Why is that needed?
These are error messages, not post previews, and the wp_die() page they end up on don't even have the same styles set for either the current theme or wp-admin which would result in displaying them in yet a third, completely different way then the user is expecting to see them. Here, we're only concerned about the user identifying the corresponding post that failed, not display it.
That, and it's one less place to worry about CSRF if it were ever a problem in post titles (not saying the post edit pages don't already trust titles with markup, but limiting the locations this is exposed is still ideal).
I guess this probably needs applying to all bulk actions.
Moving to Future for now - no Patch yet.