WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 5 weeks ago

#11302 new enhancement

Bulk editing posts should pre-fill fields with the same value / allow for removal

Reported by: pavelevap Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.9
Component: Quick/Bulk Edit Keywords: needs-patch
Focuses: Cc:

Description

All I need is quickly move some posts from one category to another.

How to simulate this problem:

Create 2 posts in Uncategorized category.
Check both of them - Bulk actions - Edit.
There is no category selected even if both posts are in Uncategorized. When I check Category1 and click Update, both posts are now in Uncategorized and also in Category1. But no chance remove them from Uncategorized with Bulk actions.

Change History (41)

#1 @pavelevap
8 years ago

  • Cc pavelevap@… added

#2 @scribu
8 years ago

  • Component changed from UI to Administration
  • Keywords needs-patch added

Confirmed behaviour with 2.9-beta2.

#3 @scribu
8 years ago

  • Component changed from Administration to Quick Edit

Actually, no categories are checked!

#4 @scribu
8 years ago

  • Milestone changed from 2.9 to 3.0
  • Summary changed from Bulk actions for category change does not work to Can't removeCategories not checked in Quick edit
  • Type changed from defect (bug) to enhancement

The same goes for tags: the tag box will always be empty, even if both posts have one or more tags in common.

I think Quick Edit simply doesn't check similarities between posts at all, although it would be nice.

To get this working right will take some serious patching and a lot of testing. Punting to the next major release.

#5 @scribu
8 years ago

  • Summary changed from Can't removeCategories not checked in Quick edit to Bulk editing posts should pre-fill fields with the same value

#6 @nacin
8 years ago

  • Milestone changed from 3.0 to Future Release

No patch, punting.

#7 @scribu
8 years ago

Related: #12837

#8 @chased@…
7 years ago

I'd like to add that this seems to also appear when attempting to change Author with Bulk Edit. When doing so, changes are not saved.

#9 @helenyhou
5 years ago

Closed #21252 as a duplicate

#10 @SergeyBiryukov
4 years ago

Related: #19859, #24608

Last edited 4 years ago by SergeyBiryukov (previous) (diff)

#11 @helen
4 years ago

#24608 was marked as a duplicate.

#12 @helen
4 years ago

  • Summary changed from Bulk editing posts should pre-fill fields with the same value to Bulk editing posts should pre-fill fields with the same value / allow for removal

I could have sworn there was a comment to this effect somewhere already, but repeating it probably won't hurt.

There are two paths to allowing for removal of terms when it comes to UI + flow - that it can only be done when that term is already set for all posts in the selection (pre-filling with a check), or that we implement the indeterminate state (usually indicated by a checkbox with a dash through it) that allows the category to be removed from any posts that have that term set.

Implementation-wise, given that checkboxes don't send in the $_POST array when they aren't checked, a patch probably requires a good deal of thought. As noted in #8690, this is currently an add functionality, not replace. Indeterminate checkboxes are also not standardized in browsers or available in HTML.

Note that this only applies to hierarchical taxonomies. #19859 for non-hierarchical.

#13 @ubernaut
4 years ago

  • Cc ubernaut@… added

#14 @grahamarmfield
4 years ago

  • Cc graham.armfield@… added

#15 @joshcanhelp
3 years ago

This just recently came up in a project. The main issue is removing categories as they can be added in bulk with the current controls. Here are a few simpler options that came to mind:

1) Have the quick edit box react to whether you're already sorting by category in wp-admin. Above the list of posts, you have a category drop-down that shows posts within that category. The bulk edit function could key off of that and select the category you're currently viewing. If you submit and that category is gone, it's removed from the posts selected. This means you'd need to filter, select the posts, bulk edit, deselect, then save.

2) Another way to do this would be to have a separate category list for removal. It would show all categories that have posts assigned, all of them checked by default. You'd select the posts, bulk edit, deselect whatever categories you want to remove, then save. Any post that's selected would have the deselected categories removed.

Either one of those sound feasible?

#16 @ubernaut
3 years ago

personally i think the third mixed state/dashed indicator is the most elegant and conventional solution to this issue.

#17 @joshcanhelp
3 years ago

I definitely agree. I just figured one of these might be a good stop-gap solution (particularly the first since it's the least impactful on the UI as a whole).

The mixed-state checkbox, as Helen mentioned, is not available in HTML but there are good ways to implement with JS:

http://css-tricks.com/indeterminate-checkboxes/

#18 @ubernaut
3 years ago

interesting never actually knew that guess that's my new thing of the day. thanks for the link!

:)

Last edited 3 years ago by ubernaut (previous) (diff)

#19 @SergeyBiryukov
2 years ago

#33205 was marked as a duplicate.

#20 @Cyberchicken
2 years ago

@Helen: an old html trick to make checkboxes behave:
<input name="mycheckbox" value="nay" type="hidden">
<input name="mycheckbox" value="yes" type="checkbox">
You'll always be posted eithr a "nay" or a "yes".
Three-state require js for sure.

#21 @lau@…
2 years ago

I have a specific need and a simple suggested solution.

PROBLEM:
My store sells clothing so each season I add new clothes to the "New Arrivals" category and also to whatever category they will remain in over the long term e.g "Women's pants".
So every season I need to remove all the previous seasons clothes from the "New Arrivals" category, but I need them to remain in their other categories.

SOLUTION 1:
On the Edit Product Category page put a button at the bottom [ Remove all products from this Category ]

SOLUTION 2:
On the Product Categories list page add another Bulk Action "remove products from category"

SOLUTION 3:
In the short term I'd be happy if you could give me the sql to remove a categoryid from all products with that categoryid.

Thanks in advance
Lau

Last edited 2 years ago by lau@… (previous) (diff)

#22 @SergeyBiryukov
2 years ago

I've found the Batch-Move Posts plugin helpful as a workaround.

#23 follow-up: @ubernaut
2 years ago

so have we given up on the idea of making this a core feature? Seems to me a very basic UX feature that comes up in quite a few situations. I do also think that at some point (maybe in the past already) this becomes a competitive disadvantage versus other site building platforms. Relying on third party plugins to solve a common issue really seems less than ideal to me.

#24 in reply to: ↑ 23 @SergeyBiryukov
2 years ago

Replying to ubernaut:

so have we given up on the idea of making this a core feature?

I agree that it should be a core feature, we still need a patch though.

#25 @lau@…
2 years ago

I just tried the Batch-Move posts plugin but that only deals with post categories and posts. It doesn't deal with product categories and products.

I think I've figured out the SQL to do this. Can anybody tell me if I'm missing something?
In this case 493 is the term_id of the product category.

DELETE  term_relationships 
INNER JOIN term_taxonomy 
ON term_relationships.term_taxonomy_id = term_taxonomy.term_taxonomy_id
AND term_taxonomy.term_id = 493

UPDATE kry_term_taxonomy SET
count = 0
WHERE term_taxonomy.term_id = 493

ANOTHER SOLUTION which may be easier for you guys to implement as it eliminates a lot of complexity and potential for serious bugs and user misunderstanding is to have a second icon/link column in the Product Category page, next to the "Count" column. When clicked it takes you to a completely new page that lists all the products in the category (not the page that you go to when you click "count").
This new page has (at a minimum) a tickbox next to each product and two "Bulk Actions":
1) Remove from category
2) Add specified to category (you then have a dropdown with a list of categories at the top of the page)

I think this is probably the technically easiest solution and covers all the bases, even if some bases require a little extra user effort.
I think trying to do it through the bulk edit feature of the current product list page will be technically difficult for you guys and confusing for the user. The problem is how to indicate which categories are already allocated to the set of products, and especially the categories which are only allocated to a subset of the products (greyed out tickbox). I think that many users won't know what the greyed out tickbox represents and may tick or untick it incorrectly and then you get a lot of angry people who unwittingly removed or added a bunch of products to categories that they didn't mean to.

By creating the new page for products in a category you could even add an additional cool feature: you could use the term_relationships.term_order field to store the default order that the products should be displayed on the category page, and you could let the users specify the order by either:
1) a single field on each product row that you save using ajax to term_relationships.term_order
or
2) a funky feature to drag each product row into the proper order. (Best is to have both methods so that if you have 100 products in a category and you want to move a few from the top to much lower down don't have to do lots of scrolling/dragging.

Last edited 2 years ago by SergeyBiryukov (previous) (diff)

#26 @SergeyBiryukov
2 years ago

#34849 was marked as a duplicate.

This ticket was mentioned in Slack in #core by benoitchantre. View the logs.


19 months ago

#28 @Marcoevich
19 months ago

Hi guys I was wondering if there's any progress on this one?

#29 @ubernaut
19 months ago

doesn't seem like it :(

#30 @SergeyBiryukov
18 months ago

#35548 was marked as a duplicate.

#31 @tomybyte
13 months ago

No question, if you can bulk add a category, you just should be able to remove it.
I just had the experience to mark the wrong category in bulk edit for a lot oft posts. Just saw that while clicking on the submit button. But it was to late, I just had added the wrong category.
Now I have to change this for every post. Ok with quickedit it won't take so long, but anyway it is annoying not being able to correct such a mistake in bulk edit.

#32 @thinkluke
13 months ago

Agreed, this would be a nice core feature.

This ticket was mentioned in Slack in #forums by sergey. View the logs.


11 months ago

#34 @dd32
6 months ago

#40918 was marked as a duplicate.

#35 @dd32
6 months ago

#40801 was marked as a duplicate.

#36 @SergeyBiryukov
3 months ago

#41964 was marked as a duplicate.

#37 @Virtality Marketing Solutions
3 months ago

WordPress team, why is this feature taking so long? People have been asking for it for years and it makes managing products and large blogs a real pain. This is why people are now moving to solutions like Shopify. I'm a huge WordPress fan and want to stay one :-) Please get this one on deck please please :-)

#38 @Michalooki
5 weeks ago

If it is not possible for now to add this feature of pre-fill fields with the same value / allow for removal,
Will it be possible to to add some kind of extra field that allow to make a bulk removal of a category from a list of posts? This will help alot. Thanks.

#39 @ubernaut
5 weeks ago

Seems hard for me to believe, not actually being a programmer myself, that none of these people who keep bringing this up have the skills to implement this or that the powers that be arent sick of marking other tickets as duplicates.

Obviously, there is demand and we've had the UX worked out for years now. This is a very basic problem and i feel like it may signify a greater problem with the whole process of waiting till some one person or group who happens to have the capability to do something about it cares enough about this specific thing to do something.

Meanwhile, a great number of people pay the price through clunky and arduous UX. Bulk de-selection is not rocket science and we should not be treating it as such, imo.

#40 @dmsnell
5 weeks ago

After some conversations today I stumbled upon this ticket after thinking, "if the ability to bulk-remove categories isn't in WordPress already it must have some challenging long-term issues." Turns out I was right! Anyway I'd love to try and eye this ticket for Contributor Day at WordCamp US 2017 and on that hope would love to get some conversation/feedback started here so I can prepare for it.

Since it's been four years since issues with browser compatibility for indeterminate checkboxes was discussed I decided to look it up: all major browsers should support the tri-state box but it's still not possible to indicate that indeterminate state with HTML only - one must use JavaScript.

https://html.spec.whatwg.org/multipage/input.html#dom-input-indeterminate

Question one is how we feel about the tri-state checkbox in general. Is it the right idiom? I wasn't sure if the indeterminate state should imply that the category should be removed or if it would mean we aren't intending on changing the category. My conclusion was that unchecked should imply removing the category, checked should imply adding the category, and indeterminate should imply not changing anything.

Maybe on account of this confusion I had a hard time seeing the tri-state actually solving our wants. It's almost as if we need something else in addition to the checkbox.

Question two is how important it is to us that this all work without JavaScript. I believe that we should be able to figure out how to make this all work with the appropriate scripting before submitting the form, but does the form have to be able to work without it? The list of posts to the left of the category box appears to already rely on JavaScript for its functioning.

Question three is maybe less important for discussion because we can always "make it work" but how should we represent this on the API side. My guess is that we can probably add some new "categories to remove" attribute in the request.


It was hard for me to think up examples of existing UI for this purpose. LightRoom doesn't use checkboxes: they have tag names, tag names with a star at the end, and the absence of tag names to indicate "all items have this tag," "some items have this tag," and "no items have this [non-visible] tag." It doesn't list all of the available tags either, which is a bit simpler than our category bulk edit box.

After some doodling I came up with an idea which would indicate both the addition or not of a category as well as its removal: a hoverable x to the left of the checkmark. The video below is crude and a prototype and is only there for the idea. The picture shows one way we might be able to indicate that a category is on the removal list.

https://cldup.com/TMlmeM2_WU.gif https://cldup.com/ZYUaFYRQQ3.png


This makes me wonder too if a radio button isn't technically more appropriate. Of course the styling would need to be made nice but I think we're truly dealing with a tai-state field: add to all, remove from all, or leave them all as they are.

Could we style a radio button in a way that communicates these states the way we want?

Anyway, thanks to all who provide feedback here. Once I have a better idea of what we would want to build I can work on creating a patch.

#41 @ubernaut
5 weeks ago

Thanks, @dmsnell for your thoughtful response and willingness to chip in to try to make this happen. :) My vote on Q1 is for the Tri state (dashed checkbox) UI at this point. It is the only solution to this issue i've ever seen used anywhere else. You cannot set the third state it is always preset to indicate a mixed selection. Unchecking it sets all selected items to the false state, checking it sets all to true, not clicking simply leaves everything the way it is.

Not saying it's the best solution but it is the simplest, most intuitive one imo, at least that ive seen to date.

No opinion on Q 2 or 3 bc i cant code my way out of a paper bag, sorry.

Last edited 5 weeks ago by ubernaut (previous) (diff)
Note: See TracTickets for help on using tickets.