Drupal 6 patch for the feature request raised in issue #321611: Batch update node titles.

Comments

drewish’s picture

StatusFileSize
new1.39 KB

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

drewish’s picture

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.

drewish’s picture

Status: Needs review » Closed (duplicate)

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

Gerald Mengisen’s picture

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.

fago’s picture

Status: Closed (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.

patchak’s picture

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

Status: Fixed » Closed (fixed)

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

takinola’s picture

Version: 6.x-1.x-dev » 6.x-1.1
Status: Closed (fixed) » 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

takinola’s picture

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)

patchak’s picture

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

Parkes Design’s picture

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

Encarte’s picture

subscribing

fago’s picture

Status: Active » Fixed

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

Status: Fixed » Closed (fixed)

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

gagarine’s picture

I try the #9 and it work but geocode from a field don't work any more :(
I open an issue #574894: Rules triger "After updating existing content" erase Geo field

Tom Freudenberg’s picture

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

socialnicheguru’s picture

removed - commented on wrong issue

geerlingguy’s picture

Just wanted to confirm that this works great for me.

Q2U’s picture

#9 worked great for me also...thanks for the tip!

Stomper’s picture

So this functionality is now in 6x.1.2? I'd like to resave specific content types on the creation of new content to update the tokens in the autonodetitle.

On a somewhat related note, you can "update automatic nodetitles" under the "content" view "update" options. It seems logical that should be an action that can be enabled using rules except on the closest option is to "save a content."

fuzzy76’s picture

Issue summary: View changes

I have 300 pages of nodes. I don't consider this a good fix. :-/