I just got really tired today of updating node titles via the site for pages of nodes, so I wrote this auto_nodetitle.drush.inc

drush ant sometype anothertype
drush ant all

It doesn't use batch api (yet).

Compressed attachment due to upload issues.

Members fund testing for the Drupal project. Drupal Association Learn more


asciikewl’s picture

Drat. It seems to be suffering from the problems with token replacement :(

skizzo’s picture

asciikewl’s picture

Seems I have it working. It was failing to update the node titles because drush runs as UID0. So by adding:

--- a/modules/auto_nodetitle/auto_nodetitle.drush.inc
+++ b/modules/auto_nodetitle/auto_nodetitle.drush.inc
@@ -32,6 +32,8 @@ function auto_nodetitle_drush_help($section) {
* Drush callback to perform actual auto_nodetitle preset flush.
function drush_auto_nodetitle_drush_update() {
+ global $user;
+ $user = user_load(1);
$args = func_get_args();
if (empty($args)) {
drush_set_error(dt('You must specify a node type name to recreate or specify "all".'.

It seems to fix it.

Rename attached file to auto_nodetitle.drush.inc

xamanu’s picture

Status: Needs review » Reviewed & tested by the community

tested #3 with a specific content type. Works like a charm. Thank you! :-)

asciikewl’s picture

Version: 6.x-1.2 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs review
910 bytes

Here is a _very_ quick re-write for d7.

christowm’s picture

911 bytes

I tested out the D7 version of this drush command and it still had a D6 function call in it. Replaced the function call with the appropriate D7 version and it works like a charm now.

msielski’s picture

Issue summary: View changes
877 bytes

The code from #6 works for the most part, but there were a few bugs which prevented the last block of nodes from ever being updated. I fixed that and cleaned up a few other minor points. This is for D7.