Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Consider adding a bulk update of terms from the admin/content/node page. A user who created his nodes before his vocabularies at UB User Testing 2009 went to the admin/content/node page to try and bulk update his nodes to add the terms he wanted. This seems like a nice feature.
Comment | File | Size | Author |
---|---|---|---|
#9 | taxonomy_term_add_node_operation-394496_2.patch | 4.95 KB | derhasi |
Comments
Comment #1
derhasi CreditAttribution: derhasi commentedI currently think about an approaches.
* The first step may be to add an action for adding a new term to a node.
Form:
* Adding a new fieldset to admin/content/content where you can select the vocabulary and term to add
* validation has to check, whether the content type is assigned to the vocabulary selected
Additional opportunities where to bulk remove tags from nodes and maybe bulk switch terms from one to another.
Comment #2
derhasi CreditAttribution: derhasi commentedExtending
hook_node_operations
with some "additional form" could deal with that issue, by adding a new update option Add term to node.Comment #3
derhasi CreditAttribution: derhasi commentedIn a first step I created a trigger action Add a taxonomy term to a node..
Next step would be to extend node operations.
Comment #4
derhasi CreditAttribution: derhasi commentedComment #5
derhasi CreditAttribution: derhasi commentedComment #6
derhasi CreditAttribution: derhasi commentedCould provide this functionality without adding actions. Therefore I used
hook_node_operations
and some form alter viataxonomy_form_node_admin_content_alter
to add an additional information box to the admin/content/content, after selecting "Add a term to nodes".Patch attached.
Comment #7
derhasi CreditAttribution: derhasi commentedScreenshot attached.
Comment #8
derhasi CreditAttribution: derhasi commented* Code style issues removed
* added some more check to avoid "no-change-savess"
* added drupal_set_message
Comment #9
derhasi CreditAttribution: derhasi commentedAnother improvement with more status messages. Guess the last one for today for me.
If this patch will be reviewed successfully, we could think about "removing terms".
Comment #10
Dries CreditAttribution: Dries commentedI applied the patch but did not understand how it worked. The help text, and the checkbox, confused me. I think we need to work on the labels and help text.
I have not reviewed the code yet.
What I need more than this, is an interface to mass administer node terms. That includes seeing what nodes have which terms, and having the ability to delete and add terms quickly. While this patch is helpful, it doesn't help me with the overview or deletion of terms. There might be other ways to go about this. I think the way Google Mail does filter creation might be a good example. First, you search or filter what nodes you want to tag, you get a preview of the selected nodes, and then you add a term to them. You can sort of do that today, but it is not as clear. I think we're close though.
Comment #11
derhasi CreditAttribution: derhasi commentedTechnically the patch works like the delete node operation does. When the add term operation is selected, the form gets altered on refresh to wait for additional entry (selecting the term to add to the node). For some reason I did not get to override the form completely via form alter.
For having better control on the node operations, maybe it would be a better approach to extend the
hook_node_operations()
with acallback form
, that can alter or provide additional callback arguments for the callback function. That would need API addition in node module.Depending on the taxonomy problem, then we could provide a more user friendly form, with maybe node preview, or at least a column with existing node terms.
What do you think about that approach?
Comment #12
derhasi CreditAttribution: derhasi commentedOpened an issue for extending
hook_node_operations()
that could ease this issue as described above:#505466: Extending hook_node_operations for supporting forms.
Comment #13
moshe weitzman CreditAttribution: moshe weitzman commented@Dries - you should really check out Views Bulk Operations if you have not already. That completely solves this need, and about 1000 other ones that admins often have. Bulk updating from anything to anything is completely solved. And not just for nodes either. Users, comments, feed items, etc. Folks are welcome to work hard on one or two use cases like this issue for core. But I see no utility in that.
Comment #14
Bojhan CreditAttribution: Bojhan commented@moshe But the answer to fixing this issue, shouldn't be download Views Bulk Operations?
Comment #15
moshe weitzman CreditAttribution: moshe weitzman commentedThis is a feature request for a feature which IMO belongs in contrib. At least core cannot do it nearly as well as contrib until we have all of views in core which is currently estimated for drupal 18.
Comment #16
catchThis really looks like 'views bulk operations in core' to me as well. I think we need a package with views, views bulk operations and default views set up and enabled which override the core interfaces to add features like this, until Views is in core.
Comment #18
wwwoliondorcom CreditAttribution: wwwoliondorcom commentedHello,
Do you know what could be a SQL query or any other way to add a chosen term to all the nodes without a term ?
Thanks a lot.
Comment #19
catchMoving to Drupal 8.
Comment #20
derhasi CreditAttribution: derhasi commentedComment #21
derhasi CreditAttribution: derhasi commentedHm, I guess this issue isn't feasible directly anymore, as we deal with fields in core. That issue was started when that was not the case.
However this could be tackled by VBO Actions in core.
The whole admin views in core seems/seemed to take place here: #1823608: Admin views in core
Comment #24
andypost