Batch update node titles (for D6)
GeraldMengisen - January 17, 2009 - 22:17
| Project: | Automatic Nodetitles |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Drupal 6 patch for the feature request raised in issue #321611: Batch update node titles.
| Attachment | Size |
|---|---|
| AutmaticNodetitles-BatchUpdateNodetitlesD6.patch | 1.31 KB |

#1
here's a re-roll with some coding standards clean ups. works great for me.
#2
i think that this might be a duplicate of #348860: Operate during nodeapi('presave'), not node form submit handler. the trick being that you could use vbo's node save action on the -dev release. hopefully we can get fago to do a new stable realase.
#3
just confirmed that you can get this functionality from -dev using the node save operation.
#4
Thanks for the feedback. I don't understand this part, however:
>>just confirmed that you can get this functionality from -dev using the node save operation.
How did you invoke the node save?
The goal of this patch is to provide an explicit way in the user interface to update the node titles of a well defined range of nodes.
#5
@drewish: right this works fine, but with the node operation it's easily possible to batch update the titles without installing another module.
@patch: When looking at the patch I notices some issues, which are also in the 5.x version. When the title is updated, it's done two time times. Furthermore it updated the title even for node types where it wasn't activated. I've fixed both issues and committed it to 6.x-1.x-dev. Please test.
#6
I tested this version and it works great, I updates several hundred nodes and all seems well. Would be nice to be able to select "all" nodes tho, not just the ones on the "admin/content/node" page..
Thanks for the cool feature!
Patchak
#7
Automatically closed -- issue fixed for 2 weeks with no activity.
#8
Is there a way to access this functionality programatically? For instance, I'd like to be able to use the Rules or Workflow modules to invoke the automatic title update (or in the worst case, invoke it using a PHP script).
Thanks,
Tolu
#9
Ok, I figured it out.
Just use the Rules module (or Workflow-NG, if you're on Drupal 5) and set a rule to trigger after the node is saved (or whatever is appropriate for your situation). Set a Execute Custom PHP Code action and put in the following command
auto_nodetitle_set_title($node);node_save($node);
Everytime the trigger occurs, the Rule will ensure that auto-node title runs on the node. This is also a good workaround to the Token effect (i.e. when batch updating nodes, the Token doesn't refresh and so Auto Node Title ends up using the exact same token replacement for each node, see http://drupal.org/node/355067)
#10
Thanks for the tip. I used VBO to mass update node titles after the import as my workaround! ;)
#11
Hat off to you takinola! you are a legend... thanks for your solution.
#12
subscribing
#13
For rules also a simple "save content" action would do it too.
#14
Automatically closed -- issue fixed for 2 weeks with no activity.
#15
I try the #9 and it work but geocode from a field don't work any more :(
I open an issue #574894: Geocode don't work with rules with triger "after the node is saved "
#16
Hi, maybe this will help you too when trying to use NID as part of node title: http://drupal.org/node/194197#comment-2149246