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.

AttachmentSize
AutmaticNodetitles-BatchUpdateNodetitlesD6.patch1.31 KB

#1

drewish - February 3, 2009 - 02:31

here's a re-roll with some coding standards clean ups. works great for me.

AttachmentSize
auto_nodetitle_360359.patch 1.39 KB

#2

drewish - February 3, 2009 - 02:47

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

drewish - February 3, 2009 - 03:16
Status:needs review» duplicate

just confirmed that you can get this functionality from -dev using the node save operation.

#4

GeraldMengisen - February 4, 2009 - 12:35

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

fago - February 10, 2009 - 10:09
Status:duplicate» fixed

@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

patchak - February 20, 2009 - 12:25

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

System Message - March 6, 2009 - 12:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#8

takinola - April 10, 2009 - 16:01
Version:6.x-1.x-dev» 6.x-1.1
Status:closed» active

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

takinola - April 10, 2009 - 17:33

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

patchak - April 17, 2009 - 23:37

Thanks for the tip. I used VBO to mass update node titles after the import as my workaround! ;)

#11

Parkes Design - April 27, 2009 - 13:25

Hat off to you takinola! you are a legend... thanks for your solution.

#12

Encarte - June 27, 2009 - 20:23

subscribing

#13

fago - July 31, 2009 - 11:59
Status:active» fixed

For rules also a simple "save content" action would do it too.

#14

System Message - August 14, 2009 - 12:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#15

gagarine - September 11, 2009 - 16:46

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

Tom Freudenberg - October 14, 2009 - 11:35

Hi, maybe this will help you too when trying to use NID as part of node title: http://drupal.org/node/194197#comment-2149246

 
 

Drupal is a registered trademark of Dries Buytaert.