Opened 15 years ago
Closed 15 years ago
#11184 closed defect (bug) (fixed)
Bulk actions executed on empty list causes errors
Reported by: | sirzooro | Owned by: | westi |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Warnings/Notices | Keywords: | |
Focuses: | Cc: |
Description
When you try to execute bulk actions but do not select at least item first, WP displays errors:
- attempt to buld edit posts - PHP notice:
Notice: Undefined variable: authors_dropdown in C:\wordpress29.local\wp-admin\includes\template.php on line 1118
- attempt to delete tags or custom taxonomies - WP Failure Notice screen:
Notice: Undefined index: tag_ID in C:\wordpress29.local\wp-admin\edit-tags.php on line 47
Are you sure you want to do this?
Please try again.
- attempt to delete categories - WP Failure Notice screen:
Notice: Undefined index: cat_ID in C:\wordpress29.local\wp-admin\categories.php on line 37
Notice: Undefined property: WP_Error::$name in C:\wordpress29.local\wp-includes\category.php on line 186
Your attempt to delete this category: “” has failed.
Please try again.
Attachments (7)
Change History (24)
#2
in reply to:
↑ 1
@
15 years ago
- Component changed from General to Warnings/Notices
- Owner set to westi
Replying to sirzooro:
One more thing: when you try to delete permanently posts in trash in bulk, WP displays displays all posts instead of trashed ones only.
You should open a separate ticket for that.
#3
@
15 years ago
This ticket is not only for PHP notices - they should be of course fixed. My main intention is to stop calling wp_die() when no items are selected for bulk action - WP should either do nothing (maybe just reload page), or display some warning like "no items selected".
#4
@
15 years ago
- Keywords has-patch added; needs-patch removed
attachment 11184.diff added
- bulk edit posts
- Initialize variable to prevent unset warnings
- indent code to show the if branch better.
Other issues not touched.
#6
@
15 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
My patch did no fix the other mentioned warnings in this ticket.
#8
@
15 years ago
These patches do not fix the main reason why I logged this ticket - WP calls wp_die() when you do not select any tag/taxonomy/category for bulk delete. I think WP should show fading warning in such cases.
The same is for bulk post remove - see my 1st reply.
#9
@
15 years ago
New patch.
- If no tags or categories selected on a bulk delete, flash "No (tags|categories) selected."
- If categories are bulk-deleted, there was previously no flash. Patch adds them. Patch also checks how many tags/cats are deleted to serve the appropriate message.
I'm thinking this can make it into 2.9. The post edit.php issues are trivial -- while there isn't any feedback, but it also doesn't wp_die(). Let's do that in a new ticket, and prevent bulk edit from opening if no posts are selected.
FWIW, re:
One more thing: when you try to delete permanently posts in trash in bulk, WP displays displays all posts instead of trashed ones only.
I don't recall another ticket to fix this, in which case I can't reproduce in r12314.
#10
@
15 years ago
Latest also includes link-manager.php
Still todo but lower priority: posts, pages. Also: media, comments.
#11
@
15 years ago
This quick patch won't allow bulk edit to appear if nothing is selected. No feedback is better than a box that opens that can't be used.
Just found another E_NOTICE issue for plugins bulk actions. I suppose I should roll all of these patches into one? Current ones are 11184-cats-tags-links-3.2, 4-bulkedit and 5-plugins.
For 3.0: Add feedback to posts, pages, media, comments, plugins screens. (Or, remove "No (tax) selected" feedback from tags/tax, cats, link-cats, for consistency.)
#12
@
15 years ago
Yeah, it probably would have been better if all patches were in one diff, perhaps for the next ticket.
#13
@
15 years ago
Latest patch (11184-merged-for-2.9.patch) contains all fixes mentioned here, aside from the ones we can leave for 3.0.
#14
@
15 years ago
It seems there are some other problems at these places, like the action for single delete (when no JS) is the same as the action for bulk delete, etc. Perhaps better to rename all bulk actions to something like "bulk-delete".
Don't think we can get this in 2.9 as there may be plugin compatibility issues. Will apply the part of the patch that clears the PHP notices but will leave the rest for 3.0 as it's better to fix all these properly and add "Nothing selected" messages, etc.
One more thing: when you try to delete permanently posts in trash in bulk, WP displays displays all posts instead of trashed ones only.